Input: Reduce use of filter in DeliverEvents
Instead of switching on the event filter to determine delivery, use the event type instead. Signed-off-by: Daniel Stone <daniel@fooishbar.org> 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
8a0241656c
commit
ea71495ada
44
dix/events.c
44
dix/events.c
|
@ -2466,9 +2466,8 @@ int
|
|||
DeliverEvents(WindowPtr pWin, xEvent *xE, int count,
|
||||
WindowPtr otherParent)
|
||||
{
|
||||
Mask filter;
|
||||
int deliveries;
|
||||
DeviceIntRec dummy;
|
||||
int deliveries;
|
||||
|
||||
#ifdef PANORAMIX
|
||||
if(!noPanoramiXExtension && pWin->drawable.pScreen->myNum)
|
||||
|
@ -2479,11 +2478,42 @@ DeliverEvents(WindowPtr pWin, xEvent *xE, int count,
|
|||
return 0;
|
||||
|
||||
dummy.id = XIAllDevices;
|
||||
filter = GetEventFilter(&dummy, xE);
|
||||
if ((filter & SubstructureNotifyMask) && (xE->u.u.type != CreateNotify))
|
||||
xE->u.destroyNotify.event = pWin->drawable.id;
|
||||
if (filter != StructureAndSubMask)
|
||||
return DeliverEventsToWindow(&dummy, pWin, xE, count, filter, NullGrab);
|
||||
|
||||
switch (xE->u.u.type)
|
||||
{
|
||||
case DestroyNotify:
|
||||
case UnmapNotify:
|
||||
case MapNotify:
|
||||
case MapRequest:
|
||||
case ReparentNotify:
|
||||
case ConfigureNotify:
|
||||
case ConfigureRequest:
|
||||
case GravityNotify:
|
||||
case CirculateNotify:
|
||||
case CirculateRequest:
|
||||
xE->u.destroyNotify.event = pWin->drawable.id;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (xE->u.u.type)
|
||||
{
|
||||
case DestroyNotify:
|
||||
case UnmapNotify:
|
||||
case MapNotify:
|
||||
case ReparentNotify:
|
||||
case ConfigureNotify:
|
||||
case GravityNotify:
|
||||
case CirculateNotify:
|
||||
break;
|
||||
default:
|
||||
{
|
||||
Mask filter;
|
||||
filter = GetEventFilter(&dummy, xE);
|
||||
return DeliverEventsToWindow(&dummy, pWin, xE, count, filter,
|
||||
NullGrab);
|
||||
}
|
||||
}
|
||||
|
||||
deliveries = DeliverEventsToWindow(&dummy, pWin, xE, count,
|
||||
StructureNotifyMask, NullGrab);
|
||||
if (pWin->parent)
|
||||
|
|
Loading…
Reference in New Issue