diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-27 12:14:32 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-06-08 13:57:01 +1000 |
commit | a1beae635caf81ec31a8998687df0ae92b505fda (patch) | |
tree | ac7ecfe35eb416b195efbc4c24ddc969f6d775d7 | |
parent | 58e4831ed68c2fbc219c7250e9837e76a73a6432 (diff) |
dix: split DeliverEventToWindowMask up a bit more.
Move out the actual event delivery, it needs to be used from elsewhere.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r-- | dix/events.c | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/dix/events.c b/dix/events.c index 66fbe9a47..9063c28f5 100644 --- a/dix/events.c +++ b/dix/events.c @@ -2076,35 +2076,27 @@ out: } /** - * Deliver events to clients registered on the window. - * - * @param client_return On successful delivery, set to the recipient. - * @param mask_return On successful delivery, set to the recipient's event - * mask for this event. + * Try delivery on each client in inputclients, provided the event mask + * accepts it and there is no interfering core grab.. */ static enum EventDeliveryState -DeliverEventToWindowMask(DeviceIntPtr dev, WindowPtr win, xEvent *events, - int count, Mask filter, GrabPtr grab, - ClientPtr *client_return, Mask *mask_return) +DeliverEventToInputClients(DeviceIntPtr dev, InputClients *inputclients, + WindowPtr win, xEvent *events, + int count, Mask filter, GrabPtr grab, + ClientPtr *client_return, Mask *mask_return) { int attempt; - enum EventDeliveryState rc = EVENT_SKIP; - InputClients *other; + enum EventDeliveryState rc = EVENT_NOT_DELIVERED; - if (!GetClientsForDelivery(dev, win, events, filter, &other)) - goto out; - - rc = EVENT_NOT_DELIVERED; - - for (; other; other = other->next) + for (; inputclients; inputclients = inputclients->next) { Mask mask; - ClientPtr client = rClient(other); + ClientPtr client = rClient(inputclients); if (IsInterferingGrab(client, dev, events)) continue; - mask = GetEventMask(dev, events, other); + mask = GetEventMask(dev, events, inputclients); if (XaceHook(XACE_RECEIVE_ACCESS, client, win, events, count)) @@ -2125,12 +2117,34 @@ DeliverEventToWindowMask(DeviceIntPtr dev, WindowPtr win, xEvent *events, } } -out: return rc; } /** + * Deliver events to clients registered on the window. + * + * @param client_return On successful delivery, set to the recipient. + * @param mask_return On successful delivery, set to the recipient's event + * mask for this event. + */ +static enum EventDeliveryState +DeliverEventToWindowMask(DeviceIntPtr dev, WindowPtr win, xEvent *events, + int count, Mask filter, GrabPtr grab, + ClientPtr *client_return, Mask *mask_return) +{ + InputClients *clients; + + if (!GetClientsForDelivery(dev, win, events, filter, &clients)) + return EVENT_SKIP; + + return DeliverEventToInputClients(dev, clients, win, events, count, filter, + grab, client_return, mask_return); + +} + + +/** * Deliver events to a window. At this point, we do not yet know if the event * actually needs to be delivered. May activate a grab if the event is a * button press. |