dix: only allow button and key events to freeze a sync'd pointer

If a client calls XAllowEvents(SyncPointer) it expects events as normal until
the next button press or release event - that freezes the device. An e.g.
proximity event must thus not freeze the pointer.

As per the spec, only button and key events may do so, so narrow it to these
cases.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2013-09-04 15:34:26 +10:00
parent 93a27b2dd0
commit be6ea80b79
1 changed files with 5 additions and 1 deletions

View File

@ -4268,7 +4268,11 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
if (deliveries && (event->any.type == ET_Motion))
thisDev->valuator->motionHintWindow = grab->window;
}
if (deliveries && !deactivateGrab && event->any.type != ET_Motion) {
if (deliveries && !deactivateGrab &&
(event->any.type == ET_KeyPress ||
event->any.type == ET_KeyRelease ||
event->any.type == ET_ButtonPress ||
event->any.type == ET_ButtonRelease)) {
switch (grabinfo->sync.state) {
case FREEZE_BOTH_NEXT_EVENT:
dev = GetPairedDevice(thisDev);