diff options
| author | Iain Lane <iain@orangesquash.org.uk> | 2014-10-02 10:40:31 +0100 |
|---|---|---|
| committer | Iain Lane <iain@orangesquash.org.uk> | 2014-10-02 10:40:31 +0100 |
| commit | 7c4c6ee6d0e7a3ba45e2430461de7da40170c7c5 (patch) | |
| tree | bdc264e53c3a3e375aaa098a0f3a0f6c3772a8ef /unity-shared | |
| parent | c23ec7167a657bf41a15d5f5449ff2a9c11b5ac2 (diff) | |
GDK (sometimes) strips the "XF86" prefix from keys
If compiz doesn't recognise the key, try with "XF86" prefixed, to keep compatible with GNOME/unity-control-center. See: https://git.gnome.org/browse/mutter/commit/src/core/meta-accel-parse.c?id=8d29d22e991f8816f47529e366a947b3565993e8 (bzr r3875.1.1)
Diffstat (limited to 'unity-shared')
| -rw-r--r-- | unity-shared/GnomeKeyGrabber.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/unity-shared/GnomeKeyGrabber.cpp b/unity-shared/GnomeKeyGrabber.cpp index a7d078de1..69d4447b8 100644 --- a/unity-shared/GnomeKeyGrabber.cpp +++ b/unity-shared/GnomeKeyGrabber.cpp @@ -200,6 +200,13 @@ unsigned int GnomeGrabber::Impl::grabAccelerator(char const* accelerator, unsign CompAction action; action.keyFromString(accelerator); + if (action.keyToString() == "Disabled") { + CompString prefixed = "XF86" + CompString(accelerator); + LOG_DEBUG(logger) << "Can't grab \"" << accelerator << "\", trying \"" << prefixed << "\""; + action.keyFromString(prefixed); + } else + LOG_DEBUG(logger) << "grabAccelerator \"" << accelerator << "\""; + if (!isActionPostponed(action)) { action.setState(CompAction::StateInitKey); |
