[gnome-settings-daemon] common: Fix function keys not being grabbed



commit d73063ca2ce0cb01f35cef4396876d8dd2032362
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jul 1 13:32:30 2011 +0100

    common: Fix function keys not being grabbed
    
    Because they were unmodified, and we tried to avoid screwing
    up the user's keymaps for those.
    
    Bug was introduced in 469145ff59fe2a65d603cfeb5011427dc0f7c36b
    
    https://bugzilla.gnome.org/show_bug.cgi?id=649222

 plugins/common/gsd-keygrab.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/plugins/common/gsd-keygrab.c b/plugins/common/gsd-keygrab.c
index 17e287c..31c1ba6 100644
--- a/plugins/common/gsd-keygrab.c
+++ b/plugins/common/gsd-keygrab.c
@@ -45,6 +45,9 @@ static GdkModifierType gsd_used_mods = 0;
 #define XF86KEYS_RANGE_MIN 0x10080001
 #define XF86KEYS_RANGE_MAX 0x1008FFFF
 
+#define FKEYS_RANGE_MIN GDK_KEY_F1
+#define FKEYS_RANGE_MAX GDK_KEY_F35
+
 #define IN_RANGE(x, min, max) (x >= min && x <= max)
 
 static void
@@ -139,11 +142,12 @@ grab_key_unsafe (Key                 *key,
         /* If key doesn't have a usable modifier, we don't want
          * to grab it, since the user might lose a useful key.
          *
-         * The exception is the XFree86 keys (which are useful to grab without
-         * a modifier).
+         * The exception is the XFree86 keys and the Function keys
+         * (which are useful to grab without a modifier).
          */
         if ((modifiers & gsd_used_mods) == 0 &&
-            (IN_RANGE(key->keysym, XF86KEYS_RANGE_MIN, XF86KEYS_RANGE_MAX))) {
+            IN_RANGE(key->keysym, XF86KEYS_RANGE_MIN, XF86KEYS_RANGE_MAX) &&
+            IN_RANGE(key->keysym, FKEYS_RANGE_MIN, FKEYS_RANGE_MAX)) {
                 GString *keycodes;
 
                 keycodes = g_string_new ("");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]