diff options
author | Daniel Stone <daniels@collabora.com> | 2015-11-20 15:37:31 +0000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-11-24 11:36:36 +1000 |
commit | fee0827a9a695600765f3d04376fc9babe497401 (patch) | |
tree | 4c6a033d0567b63cce293ac5eebc57f19c41eeca | |
parent | 816015648ffe660ddaa0f7d4d192e555b723c372 (diff) |
XWayland: Use FocusIn events for keyboard enter
wl_keyboard::enter is the equivalent of FocusIn + KeymapNotify: it
notifies us that the surface/window has now received the focus, and
provides us a set of keys which are currently down.
We should use these keys to update the current state, but not to send
any events to clients.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | hw/xwayland/xwayland-input.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 0515eb950..473f30602 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -432,7 +432,7 @@ keyboard_handle_enter(void *data, struct wl_keyboard *keyboard, wl_array_copy(&xwl_seat->keys, keys); wl_array_for_each(k, &xwl_seat->keys) - QueueKeyboardEvents(xwl_seat->keyboard, KeyPress, *k + 8); + QueueKeyboardEvents(xwl_seat->keyboard, KeymapNotify, *k + 8); } static void @@ -444,6 +444,10 @@ keyboard_handle_leave(void *data, struct wl_keyboard *keyboard, xwl_seat->xwl_screen->serial = serial; + /* Unlike keymap_handle_enter above, this time we _do_ want to trigger + * full release, as we don't know how long we'll be out of focus for. + * Notify clients that the keys have been released, disable autorepeat, + * etc. */ wl_array_for_each(k, &xwl_seat->keys) QueueKeyboardEvents(xwl_seat->keyboard, KeyRelease, *k + 8); |