keybindings: Don't bother not reloading keymaps for MappingModifier

Now that we always use XKB, it's very unlikely that we'll get a
MappingNotifier without a subsequence XkbKeymapNotify event. Just
do all the work always.

This will also help us considerably for the future when we'll be
putting the keymap event in the backend.
This commit is contained in:
Jasper St. Pierre 2014-08-14 14:25:43 -04:00
parent e830b66604
commit 1e30db64d1

View File

@ -924,40 +924,9 @@ meta_display_get_keybinding_action (MetaDisplay *display,
void void
meta_display_process_mapping_event (MetaDisplay *display, meta_display_process_mapping_event (MetaDisplay *display,
XEvent *event) XEvent *event)
{
gboolean keymap_changed = FALSE;
gboolean modmap_changed = FALSE;
if (event->type == display->xkb_base_event_type)
{
meta_topic (META_DEBUG_KEYBINDINGS,
"XKB mapping changed, will redo keybindings\n");
keymap_changed = TRUE;
modmap_changed = TRUE;
}
else if (event->xmapping.request == MappingModifier)
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Received MappingModifier event, will reload modmap and redo keybindings\n");
modmap_changed = TRUE;
}
else if (event->xmapping.request == MappingKeyboard)
{
meta_topic (META_DEBUG_KEYBINDINGS,
"Received MappingKeyboard event, will reload keycodes and redo keybindings\n");
keymap_changed = TRUE;
}
/* Now to do the work itself */
if (keymap_changed || modmap_changed)
{ {
ungrab_key_bindings (display); ungrab_key_bindings (display);
if (keymap_changed)
reload_keymap (display); reload_keymap (display);
/* Deciphering the modmap depends on the loaded keysyms to find out /* Deciphering the modmap depends on the loaded keysyms to find out
@ -965,7 +934,6 @@ meta_display_process_mapping_event (MetaDisplay *display,
* even when only the keymap changes */ * even when only the keymap changes */
reload_modmap (display); reload_modmap (display);
if (keymap_changed)
reload_keycodes (display); reload_keycodes (display);
reload_modifiers (display); reload_modifiers (display);
@ -974,7 +942,6 @@ meta_display_process_mapping_event (MetaDisplay *display,
grab_key_bindings (display); grab_key_bindings (display);
} }
}
static void static void
bindings_changed_callback (MetaPreference pref, bindings_changed_callback (MetaPreference pref,