summaryrefslogtreecommitdiff
path: root/src/core/keybindings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/keybindings.c')
-rwxr-xr-xsrc/core/keybindings.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index 1659c02..8ea6b41 100755
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -138,6 +138,10 @@ reload_keymap (MetaDisplay *display)
if (display->keymap)
meta_XFree (display->keymap);
+ /* This is expensive to compute, so we'll lazily load if and when we first
+ * need it */
+ display->above_tab_keycode = 0;
+
display->keymap = XGetKeyboardMapping (display->xdisplay,
display->min_keycode,
display->max_keycode -
@@ -249,6 +253,16 @@ reload_modmap (MetaDisplay *display)
display->meta_mask);
}
+static guint
+keysym_to_keycode (MetaDisplay *display,
+ guint keysym)
+{
+ if (keysym == META_KEY_ABOVE_TAB)
+ return meta_display_get_above_tab_keycode (display);
+ else
+ return XKeysymToKeycode (display->xdisplay, keysym);
+}
+
static void
reload_keycodes (MetaDisplay *display)
{
@@ -264,8 +278,8 @@ reload_keycodes (MetaDisplay *display)
{
if (display->key_bindings[i].keysym != 0)
{
- display->key_bindings[i].keycode = XKeysymToKeycode (
- display->xdisplay, display->key_bindings[i].keysym);
+ display->key_bindings[i].keycode =
+ keysym_to_keycode (display, display->key_bindings[i].keysym);
}
++i;