From ff799a0f5dba06beed9f13939237899e53ff8fd8 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 16 Oct 2015 17:30:46 +0200 Subject: [PATCH] Grab client keys on the client window (#496) Before this, we grabbed the keys on the frame window. That meant we only got key events for things that nothing else grabbed directly on the key window. After this, we grab directly on the client window itself and so we "fight" with everything else which wants to grab keys. I don't actually know how the winner is decided... First come, first serve, the rest gets an error? Signed-off-by: Uli Schlachter --- event.c | 2 +- objects/client.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/event.c b/event.c index 620ff04b6..db70e2ca1 100644 --- a/event.c +++ b/event.c @@ -638,7 +638,7 @@ event_handle_key(xcb_key_press_event_t *ev) /* get keysym ignoring all modifiers */ xcb_keysym_t keysym = keyresolv_get_keysym(ev->detail, 0); client_t *c; - if((c = client_getbyframewin(ev->event))) + if((c = client_getbywin(ev->event))) { luaA_object_push(globalconf.L, c); event_key_callback(ev, &c->keys, -1, 1, &keysym); diff --git a/objects/client.c b/objects/client.c index a561b895a..703362df2 100644 --- a/objects/client.c +++ b/objects/client.c @@ -2284,7 +2284,7 @@ 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); + xwindow_grabkeys(c->window, keys); } return luaA_key_array_get(L, 1, keys);