mirror of
https://github.com/X11Libre/xserver.git
synced 2026-09-21 20:26:45 +00:00
xwayland: Don't send KeyRelease events on wl_keyboard::leave
Commits816015648fandfee0827a9amade 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>
This commit is contained in:
parent
2de37eb71b
commit
5611585b87
3 changed files with 19 additions and 16 deletions
|
|
@ -1798,15 +1798,19 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
|||
break;
|
||||
}
|
||||
|
||||
if (grab)
|
||||
DeliverGrabbedEvent((InternalEvent *) event, device,
|
||||
deactivateDeviceGrab);
|
||||
else if (device->focus && !IsPointerEvent(ev))
|
||||
DeliverFocusedEvent(device, (InternalEvent *) event,
|
||||
GetSpriteWindow(device));
|
||||
else
|
||||
DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
|
||||
NullGrab, NullWindow, device);
|
||||
/* Don't deliver focus events (e.g. from KeymapNotify when running
|
||||
* nested) to clients. */
|
||||
if (event->source_type != EVENT_SOURCE_FOCUS) {
|
||||
if (grab)
|
||||
DeliverGrabbedEvent((InternalEvent *) event, device,
|
||||
deactivateDeviceGrab);
|
||||
else if (device->focus && !IsPointerEvent(ev))
|
||||
DeliverFocusedEvent(device, (InternalEvent *) event,
|
||||
GetSpriteWindow(device));
|
||||
else
|
||||
DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
|
||||
NullGrab, NullWindow, device);
|
||||
}
|
||||
|
||||
if (deactivateDeviceGrab == TRUE) {
|
||||
(*device->deviceGrab.DeactivateGrab) (device);
|
||||
|
|
|
|||
Loading…
Reference in a new issue