diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-29 14:19:20 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2014-04-29 14:21:46 -0700 |
commit | c31f624141ab03baf243441467806753b9c2bb74 (patch) | |
tree | a1344b9faf61a5c81c725108f4b370180f1d44fc /clients | |
parent | 41f7ebc36acaa2289f4f21d7fd7613364048a4fb (diff) | |
download | weston-c31f624141ab03baf243441467806753b9c2bb74.tar.gz |
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.
Diffstat (limited to 'clients')
-rw-r--r-- | clients/window.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clients/window.c b/clients/window.c index 005102b0..adcec0dc 100644 --- a/clients/window.c +++ b/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; |