dix: only deliver for the current grab type

Use the grabtype to determine which type of event to send - all other events
are pointless and may result in erroneous events being delivered.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 7cf1b595c8)
This commit is contained in:
Peter Hutterer 2013-09-04 15:34:29 +10:00
parent acb447ef69
commit 0c809f459c

View file

@ -4253,17 +4253,8 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
sendCore = (IsMaster(thisDev) && thisDev->coreEvents);
/* try core event */
if (sendCore && grab->grabtype == CORE) {
deliveries = DeliverOneGrabbedEvent(event, thisDev, CORE);
}
if (!deliveries) {
deliveries = DeliverOneGrabbedEvent(event, thisDev, XI2);
}
if (!deliveries) {
deliveries = DeliverOneGrabbedEvent(event, thisDev, XI);
}
if ((sendCore && grab->grabtype == CORE) || grab->grabtype != CORE)
deliveries = DeliverOneGrabbedEvent(event, thisDev, grab->grabtype);
if (deliveries && (event->any.type == ET_Motion))
thisDev->valuator->motionHintWindow = grab->window;