mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-09 02:38:11 +02:00
Xi: Ensure DeviceChanged is emitted after grabs are deactivated
When a grab on a slave device is deactivated, the master device must
be checked, just in case there were events from other devices while
the slave device was stolen away by the passive grab. This may
introduce misbehaviors on mismatching valuators and device features
later on UpdateDeviceState().
Signed-off-by: Carlos Garnacho <carlosg@gnome.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit b2d5ee2e36)
This commit is contained in:
parent
47da6e3f47
commit
940d6a8e9d
1 changed files with 18 additions and 1 deletions
|
|
@ -1783,8 +1783,25 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device)
|
|||
DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event,
|
||||
NullGrab, NullWindow, device);
|
||||
|
||||
if (deactivateDeviceGrab == TRUE)
|
||||
if (deactivateDeviceGrab == TRUE) {
|
||||
(*device->deviceGrab.DeactivateGrab) (device);
|
||||
|
||||
if (!IsMaster (device) && !IsFloating (device)) {
|
||||
int flags, num_events = 0;
|
||||
InternalEvent dce;
|
||||
|
||||
flags = (IsPointerDevice (device)) ?
|
||||
DEVCHANGE_POINTER_EVENT : DEVCHANGE_KEYBOARD_EVENT;
|
||||
UpdateFromMaster (&dce, device, flags, &num_events);
|
||||
BUG_WARN(num_events > 1);
|
||||
|
||||
if (num_events == 1)
|
||||
ChangeMasterDeviceClasses(GetMaster (device, MASTER_ATTACHED),
|
||||
&dce.changed_event);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
event->detail.key = key;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue