diff options
author | Rui Matos <tiagomatos@gmail.com> | 2016-11-24 19:56:18 +0100 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-01-11 14:58:44 -0500 |
commit | 738c17b7ef4c70ad00c7bc01cf64edb770dda840 (patch) | |
tree | a83fa7ba1266691903bd828cafe1cf0f842c05ec /hw/xwayland | |
parent | cd8f43e1b06aee8500548a94e3743cf153591683 (diff) |
xwayland: Don't send KeyRelease events on wl_keyboard::leave
Commits 816015648ffe660ddaa0f7d4d192e555b723c372 and
fee0827a9a695600765f3d04376fc9babe497401 made it so that
wl_keyboard::enter doesn't result in X clients getting KeyPress events
while still updating our internal xkb state to be in sync with the
host compositor.
wl_keyboard::leave needs to be handled in the same way as its
semantics from an X client POV should be the same as an X grab getting
triggered, i.e. X clients shouldn't get KeyRelease events for keys
that are still down at that point.
This patch uses LeaveNotify for these events on wl_keyboard::leave and
changes the current use of KeymapNotify to EnterNotify instead just to
keep some symmetry between both cases.
On ProcessDeviceEvent() we still need to deactivate X grabs if needed
for KeyReleases.
Signed-off-by: Rui Matos <tiagomatos@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 5611585b87ce48428a66f98ece319a083f55d205)
Diffstat (limited to 'hw/xwayland')
-rw-r--r-- | hw/xwayland/xwayland-input.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 7ec3b1a68..4d0a4579a 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -646,7 +646,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, KeymapNotify, *k + 8); + QueueKeyboardEvents(xwl_seat->keyboard, EnterNotify, *k + 8); } static void @@ -658,12 +658,8 @@ 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); + QueueKeyboardEvents(xwl_seat->keyboard, LeaveNotify, *k + 8); xwl_seat->keyboard_focus = NULL; } |