summaryrefslogtreecommitdiff
path: root/mcwm.c
diff options
context:
space:
mode:
authorMichael Cardell Widerkrantz <mc@hack.org>2011-03-20 19:38:32 +0100
committerMichael Cardell Widerkrantz <mc@hack.org>2011-03-20 19:38:32 +0100
commitef69d425dde794547b2403ab5069711bcaa366c0 (patch)
tree78c53188a194111c32eeb1b720db8ce61f5cb130 /mcwm.c
parentf3120f3f5ad8acaf1dde2728882b4f3b6c9e0a7a (diff)
downloadmcwm-ef69d425dde794547b2403ab5069711bcaa366c0.zip
Check explicitly for key and modifier mappings when remapping the
keyboard. We don't want to do anything when mouse buttons have been remapped.
Diffstat (limited to 'mcwm.c')
-rw-r--r--mcwm.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/mcwm.c b/mcwm.c
index 6a1869c..76a6c30 100644
--- a/mcwm.c
+++ b/mcwm.c
@@ -3048,18 +3048,33 @@ void events(void)
break;
case XCB_MAPPING_NOTIFY:
+ {
+ xcb_mapping_notify_event_t *e
+ = (xcb_mapping_notify_event_t *)ev;
+
/*
* XXX Gah! We get a new notify message for *every* key!
* We want to know when the entire keyboard is finished.
+ * Impossible? Better handling somehow?
*/
+ /*
+ * We're only interested in keys and modifiers, not
+ * pointer mappings, for instance.
+ */
+ if (e->request != XCB_MAPPING_MODIFIER
+ && e->request != XCB_MAPPING_KEYBOARD)
+ {
+ break;
+ }
+
/* Forget old key bindings. */
xcb_ungrab_key(conn, XCB_GRAB_ANY, screen->root, XCB_MOD_MASK_ANY);
/* Use the new ones. */
setupkeys();
-
- break;
+ }
+ break;
case XCB_UNMAP_NOTIFY:
{