mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-10 23:33:46 +00:00
End physically active touches when device is disabled
Otherwise: * We can't end the touches while device is disabled * New touches after enabling the device may erroneously be mapped to old logical touches Signed-off-by: Chase Douglas <chase.douglas@canonical.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
a69429a17b
commit
3b67cd2614
3 changed files with 30 additions and 0 deletions
|
|
@ -443,6 +443,7 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent)
|
|||
if (*prev != dev)
|
||||
return FALSE;
|
||||
|
||||
TouchEndPhysicallyActiveTouches(dev);
|
||||
ReleaseButtonsAndKeys(dev);
|
||||
SyncRemoveDeviceIdleTime(dev->idle_counter);
|
||||
dev->idle_counter = NULL;
|
||||
|
|
|
|||
28
dix/touch.c
28
dix/touch.c
|
|
@ -1029,3 +1029,31 @@ TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
|
|||
|
||||
return TouchListenerAcceptReject(dev, ti, i, mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* End physically active touches for a device.
|
||||
*/
|
||||
void
|
||||
TouchEndPhysicallyActiveTouches(DeviceIntPtr dev)
|
||||
{
|
||||
InternalEvent *eventlist = InitEventList(GetMaximumEventsNum());
|
||||
int i;
|
||||
|
||||
OsBlockSignals();
|
||||
mieqProcessInputEvents();
|
||||
for (i = 0; i < dev->last.num_touches; i++) {
|
||||
DDXTouchPointInfoPtr ddxti = dev->last.touches + i;
|
||||
|
||||
if (ddxti->active) {
|
||||
int j;
|
||||
int nevents = GetTouchEvents(eventlist, dev, ddxti->ddx_id,
|
||||
XI_TouchEnd, 0, NULL);
|
||||
|
||||
for (j = 0; j < nevents; j++)
|
||||
mieqProcessDeviceEvent(dev, eventlist + j, NULL);
|
||||
}
|
||||
}
|
||||
OsReleaseSignals();
|
||||
|
||||
FreeEventList(eventlist, GetMaximumEventsNum());
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue