From 1118ec44391b70e22dadcbc5f8b2397bdb79bafb Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 28 Jul 2015 18:52:41 +0200 Subject: [PATCH] Do not call `xcb_ungrab_key` twice (before `xwindow_grabkeys`) It gets called in `xwindow_grabkeys` always: xwindow_grabkeys(xcb_window_t win, key_array_t *keys) { /* Ungrab everything first */ xcb_ungrab_key(globalconf.connection, XCB_GRAB_ANY, win, XCB_BUTTON_MASK_ANY); Closes https://github.com/awesomeWM/awesome/pull/366. --- event.c | 3 --- objects/client.c | 1 - root.c | 1 - 3 files changed, 5 deletions(-) diff --git a/event.c b/event.c index ceccffd47..1317ff9bf 100644 --- a/event.c +++ b/event.c @@ -801,14 +801,11 @@ event_handle_mappingnotify(xcb_mapping_notify_event_t *ev) /* regrab everything */ xcb_screen_t *s = globalconf.screen; - /* yes XCB_BUTTON_MASK_ANY is also for grab_key even if it's look weird */ - xcb_ungrab_key(globalconf.connection, XCB_GRAB_ANY, s->root, XCB_BUTTON_MASK_ANY); xwindow_grabkeys(s->root, &globalconf.keys); foreach(_c, globalconf.clients) { client_t *c = *_c; - xcb_ungrab_key(globalconf.connection, XCB_GRAB_ANY, c->frame_window, XCB_BUTTON_MASK_ANY); xwindow_grabkeys(c->frame_window, &c->keys); } } diff --git a/objects/client.c b/objects/client.c index 2f04883cf..be12b0f68 100644 --- a/objects/client.c +++ b/objects/client.c @@ -2440,7 +2440,6 @@ luaA_client_keys(lua_State *L) { luaA_key_array_set(L, 1, 2, keys); luaA_object_emit_signal(L, 1, "property::keys", 0); - xcb_ungrab_key(globalconf.connection, XCB_GRAB_ANY, c->frame_window, XCB_BUTTON_MASK_ANY); xwindow_grabkeys(c->frame_window, keys); } diff --git a/root.c b/root.c index 34a170963..59534fc1d 100644 --- a/root.c +++ b/root.c @@ -238,7 +238,6 @@ luaA_root_keys(lua_State *L) key_array_append(&globalconf.keys, luaA_object_ref_class(L, -1, &key_class)); xcb_screen_t *s = globalconf.screen; - xcb_ungrab_key(globalconf.connection, XCB_GRAB_ANY, s->root, XCB_BUTTON_MASK_ANY); xwindow_grabkeys(s->root, &globalconf.keys); return 1;