window.c: Prevent key event delivery while a grab is active

Ideally, we'll update the key event handling to deliver events to widgets,
but in the meantime, just blocking key event delivery while a grab is
active goes a long way.
dev
Kristian Høgsberg 11 years ago
parent 41f7ebc36a
commit c31f624141
  1. 8
      clients/window.c

@ -2876,6 +2876,14 @@ keyboard_handle_key(void *data, struct wl_keyboard *keyboard,
if (!window || !input->xkb.state)
return;
/* We only use input grabs for pointer events for now, so just
* ignore key presses if a grab is active. We expand the key
* event delivery mechanism to route events to widgets to
* properly handle key grabs. In the meantime, this prevents
* key event devlivery while a grab is active. */
if (input->grab && input->grab_button == 0)
return;
num_syms = xkb_key_get_syms(input->xkb.state, code, &syms);
sym = XKB_KEY_NoSymbol;

Loading…
Cancel
Save