From ef69d425dde794547b2403ab5069711bcaa366c0 Mon Sep 17 00:00:00 2001 From: Michael Cardell Widerkrantz Date: Sun, 20 Mar 2011 19:38:32 +0100 Subject: Check explicitly for key and modifier mappings when remapping the keyboard. We don't want to do anything when mouse buttons have been remapped. --- mcwm.c | 19 +++++++++++++++++-- 1 file 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: { -- cgit v1.2.3