diff --git a/event.c b/event.c index 570f37c81..d096bb10a 100644 --- a/event.c +++ b/event.c @@ -840,23 +840,8 @@ event_handle_clientmessage(xcb_client_message_event_t *ev) static void event_handle_mappingnotify(xcb_mapping_notify_event_t *ev) { - if(ev->request == XCB_MAPPING_MODIFIER - || ev->request == XCB_MAPPING_KEYBOARD) - { - /* Free and then allocate the key symbols */ - xcb_key_symbols_free(globalconf.keysyms); - globalconf.keysyms = xcb_key_symbols_alloc(globalconf.connection); - - /* regrab everything TODO: Move this to xkb.c suitably */ - xcb_screen_t *s = globalconf.screen; - xwindow_grabkeys(s->root, &globalconf.keys); - - foreach(_c, globalconf.clients) - { - client_t *c = *_c; - xwindow_grabkeys(c->window, &c->keys); - } - } + /* Since we use XKB, we shouldn't get this event */ + warn("Unexpected MappingNotify of type %d", ev->request); } static void diff --git a/xkb.c b/xkb.c index 95b788844..faa80e484 100644 --- a/xkb.c +++ b/xkb.c @@ -25,6 +25,8 @@ #include "xkb.h" #include "globalconf.h" +#include "xwindow.h" +#include "objects/client.h" #include #include #include @@ -183,6 +185,21 @@ xkb_reload_keymap(void) { xkb_state_unref(globalconf.xkb_state); xkb_fill_state(); + + /* Free and then allocate the key symbols */ + xcb_key_symbols_free(globalconf.keysyms); + globalconf.keysyms = xcb_key_symbols_alloc(globalconf.connection); + + /* Regrab key bindings on the root window */ + xcb_screen_t *s = globalconf.screen; + xwindow_grabkeys(s->root, &globalconf.keys); + + /* Regrab key bindings on clients */ + foreach(_c, globalconf.clients) + { + client_t *c = *_c; + xwindow_grabkeys(c->window, &c->keys); + } } /** The xkb notify event handler.