[mutter] keybindings: Don't bother not reloading keymaps for MappingModifier
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] keybindings: Don't bother not reloading keymaps for MappingModifier
- Date: Thu, 14 Aug 2014 22:20:59 +0000 (UTC)
commit 1e30db64d15a578b1783de0e971a49dad5791a41
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Aug 14 14:25:43 2014 -0400
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.
src/core/keybindings.c | 53 +++++++++--------------------------------------
1 files changed, 10 insertions(+), 43 deletions(-)
---
diff --git a/src/core/keybindings.c b/src/core/keybindings.c
index db8708f..ebedf21 100644
--- a/src/core/keybindings.c
+++ b/src/core/keybindings.c
@@ -925,55 +925,22 @@ void
meta_display_process_mapping_event (MetaDisplay *display,
XEvent *event)
{
- gboolean keymap_changed = FALSE;
- gboolean modmap_changed = FALSE;
+ ungrab_key_bindings (display);
- 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);
-
- if (keymap_changed)
- reload_keymap (display);
+ reload_keymap (display);
- /* Deciphering the modmap depends on the loaded keysyms to find out
- * what modifiers is Super and so forth, so we need to reload it
- * even when only the keymap changes */
- reload_modmap (display);
+ /* Deciphering the modmap depends on the loaded keysyms to find out
+ * what modifiers is Super and so forth, so we need to reload it
+ * even when only the keymap changes */
+ reload_modmap (display);
- if (keymap_changed)
- reload_keycodes (display);
+ reload_keycodes (display);
- reload_modifiers (display);
+ reload_modifiers (display);
- rebuild_binding_index (display);
+ rebuild_binding_index (display);
- grab_key_bindings (display);
- }
+ grab_key_bindings (display);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]