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 <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2015-10-16 17:30:46 +02:00
parent e3253db406
commit 532ec0cd90
2 changed files with 2 additions and 2 deletions

View File

@ -666,7 +666,7 @@ event_handle_key(xcb_key_press_event_t *ev)
/* get keysym ignoring all modifiers */ /* get keysym ignoring all modifiers */
xcb_keysym_t keysym = xcb_key_symbols_get_keysym(globalconf.keysyms, ev->detail, 0); xcb_keysym_t keysym = xcb_key_symbols_get_keysym(globalconf.keysyms, ev->detail, 0);
client_t *c; client_t *c;
if((c = client_getbyframewin(ev->event))) if((c = client_getbywin(ev->event)))
{ {
luaA_object_push(L, c); luaA_object_push(L, c);
event_key_callback(ev, &c->keys, L, -1, 1, &keysym); event_key_callback(ev, &c->keys, L, -1, 1, &keysym);

View File

@ -2474,7 +2474,7 @@ luaA_client_keys(lua_State *L)
{ {
luaA_key_array_set(L, 1, 2, keys); luaA_key_array_set(L, 1, 2, keys);
luaA_object_emit_signal(L, 1, "property::keys", 0); luaA_object_emit_signal(L, 1, "property::keys", 0);
xwindow_grabkeys(c->frame_window, keys); xwindow_grabkeys(c->window, keys);
} }
return luaA_key_array_get(L, 1, keys); return luaA_key_array_get(L, 1, keys);