]> Dogcows Code - chaz/openbox/blobdiff - openbox/modkeys.c
Hide the focus popup if we change desktops and one of the windows in it disappears
[chaz/openbox] / openbox / modkeys.c
index c52cbef1aeeff4bdbb6bba65982e370c9fe7e97d..e897ccb379b144bc29de2c6e762d8950aab435f2 100644 (file)
@@ -176,14 +176,22 @@ static void set_modkey_mask(guchar mask, KeySym sym)
     /* CapsLock, Shift, and Control are special and hard-coded */
 }
 
-KeyCode modkeys_sym_to_code(KeySym sym)
+KeyCode* modkeys_sym_to_code(KeySym sym)
 {
-    gint i, j;
+    KeyCode *ret;
+    gint i, j, n;
+
+    ret = g_new(KeyCode, 1);
+    n = 0;
+    ret[n] = 0;
 
     /* go through each keycode and look for the keysym */
     for (i = min_keycode; i <= max_keycode; ++i)
         for (j = 0; j < keysyms_per_keycode; ++j)
-            if (sym == keymap[(i-min_keycode) * keysyms_per_keycode + j])
-                return i;
-    return 0;
+            if (sym == keymap[(i-min_keycode) * keysyms_per_keycode + j]) {
+                ret = g_renew(KeyCode, ret, ++n);
+                ret[n-1] = i;
+                ret[n] = 0;
+            }
+    return ret;
 }
This page took 0.022335 seconds and 4 git commands to generate.