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>
This commit is contained in:
Peter Hutterer 2013-09-04 15:34:29 +10:00
parent 78944d62ff
commit 7cf1b595c8
1 changed files with 2 additions and 11 deletions

View File

@ -4256,17 +4256,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;