summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-05-27 11:40:56 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-09-29 14:09:40 +1000
commit016413dae947fe4e8e918f728c87354fa4928275 (patch)
tree1ae1e8cb26c930fcc162332dd7634a21deffc485
parent537c5f631d1f8d526e63355b7d88cb1fb2793492 (diff)
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>
-rw-r--r--dix/events.c50
1 files changed, 36 insertions, 14 deletions
diff --git a/dix/events.c b/dix/events.c
index 3c7bd50cd..20754f0c5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2037,31 +2037,29 @@ DeliverToWindowOwner(DeviceIntPtr dev, WindowPtr win,
return EVENT_NOT_DELIVERED;
}
+
/**
- * Deliver events to clients registered on the window.
+ * Get the list of clients that should be tried for event delivery on the
+ * given 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.
+ * @return 1 if the client list should be traversed, zero if the event
+ * should be skipped.
*/
-static enum EventDeliveryState
-DeliverEventToClients(DeviceIntPtr dev, WindowPtr win, xEvent *events,
- int count, Mask filter, GrabPtr grab,
- ClientPtr *client_return, Mask *mask_return)
+static Bool
+GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win,
+ xEvent *events, Mask filter, InputClients **clients)
{
- int attempt;
- enum EventDeliveryState rc = EVENT_SKIP;
- InputClients *other;
+ int rc = 0;
if (core_get_type(events) != 0)
- other = (InputClients *)wOtherClients(win);
+ *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;
- other = inputMasks->inputClients;
+ *clients = inputMasks->inputClients;
} else {
OtherInputMasks *inputMasks = wOtherInputMasks(win);
/* Has any client selected for the event? */
@@ -2069,9 +2067,33 @@ DeliverEventToClients(DeviceIntPtr dev, WindowPtr win, xEvent *events,
!(inputMasks->inputEvents[dev->id] & filter))
goto out;
- other = inputMasks->inputClients;
+ *clients = inputMasks->inputClients;
}
+ rc = 1;
+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
+DeliverEventToClients(DeviceIntPtr dev, 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;
+
+ if (!GetClientsForDelivery(dev, win, events, filter, &other))
+ goto out;
+
rc = EVENT_NOT_DELIVERED;
for (; other; other = other->next)