dix: split client list retrieval out of DeliverEventToClients
No functional change, but "other" was renamed to "clients". Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
537c5f631d
commit
016413dae9
58
dix/events.c
58
dix/events.c
|
@ -2037,6 +2037,44 @@ DeliverToWindowOwner(DeviceIntPtr dev, WindowPtr win,
|
||||||
return EVENT_NOT_DELIVERED;
|
return EVENT_NOT_DELIVERED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the list of clients that should be tried for event delivery on the
|
||||||
|
* given window.
|
||||||
|
*
|
||||||
|
* @return 1 if the client list should be traversed, zero if the event
|
||||||
|
* should be skipped.
|
||||||
|
*/
|
||||||
|
static Bool
|
||||||
|
GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win,
|
||||||
|
xEvent *events, Mask filter, InputClients **clients)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
|
||||||
|
if (core_get_type(events) != 0)
|
||||||
|
*clients = (InputClients *)wOtherClients(win);
|
||||||
|
else if (xi2_get_type(events) != 0)
|
||||||
|
{
|
||||||
|
OtherInputMasks *inputMasks = wOtherInputMasks(win);
|
||||||
|
/* Has any client selected for the event? */
|
||||||
|
if (!GetWindowXI2Mask(dev, win, events))
|
||||||
|
goto out;
|
||||||
|
*clients = inputMasks->inputClients;
|
||||||
|
} else {
|
||||||
|
OtherInputMasks *inputMasks = wOtherInputMasks(win);
|
||||||
|
/* Has any client selected for the event? */
|
||||||
|
if (!inputMasks ||
|
||||||
|
!(inputMasks->inputEvents[dev->id] & filter))
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
*clients = inputMasks->inputClients;
|
||||||
|
}
|
||||||
|
|
||||||
|
rc = 1;
|
||||||
|
out:
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deliver events to clients registered on the window.
|
* Deliver events to clients registered on the window.
|
||||||
*
|
*
|
||||||
|
@ -2053,24 +2091,8 @@ DeliverEventToClients(DeviceIntPtr dev, WindowPtr win, xEvent *events,
|
||||||
enum EventDeliveryState rc = EVENT_SKIP;
|
enum EventDeliveryState rc = EVENT_SKIP;
|
||||||
InputClients *other;
|
InputClients *other;
|
||||||
|
|
||||||
if (core_get_type(events) != 0)
|
if (!GetClientsForDelivery(dev, win, events, filter, &other))
|
||||||
other = (InputClients *)wOtherClients(win);
|
goto out;
|
||||||
else if (xi2_get_type(events) != 0)
|
|
||||||
{
|
|
||||||
OtherInputMasks *inputMasks = wOtherInputMasks(win);
|
|
||||||
/* Has any client selected for the event? */
|
|
||||||
if (!GetWindowXI2Mask(dev, win, events))
|
|
||||||
goto out;
|
|
||||||
other = inputMasks->inputClients;
|
|
||||||
} else {
|
|
||||||
OtherInputMasks *inputMasks = wOtherInputMasks(win);
|
|
||||||
/* Has any client selected for the event? */
|
|
||||||
if (!inputMasks ||
|
|
||||||
!(inputMasks->inputEvents[dev->id] & filter))
|
|
||||||
goto out;
|
|
||||||
|
|
||||||
other = inputMasks->inputClients;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = EVENT_NOT_DELIVERED;
|
rc = EVENT_NOT_DELIVERED;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user