diff options
author | Rui Matos <tiagomatos@gmail.com> | 2016-11-24 19:56:18 +0100 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-11-29 18:44:54 +1000 |
commit | 5611585b87ce48428a66f98ece319a083f55d205 (patch) | |
tree | 6b305912b30d8da358dadfc1b4b5b3005ee661ea /dix | |
parent | 2de37eb71b928f6f50c109536c2f7b77293ad8e3 (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>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/getevents.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 4d06818cf..0d87453e5 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1101,9 +1101,12 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, } #endif - if (type == KeymapNotify) { + if (type == EnterNotify) { source_type = EVENT_SOURCE_FOCUS; type = KeyPress; + } else if (type == LeaveNotify) { + source_type = EVENT_SOURCE_FOCUS; + type = KeyRelease; } /* refuse events from disabled devices */ |