summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorJeremy Huddleston <jeremyhu@freedesktop.org>2008-09-03 09:33:39 -0700
committerJeremy Huddleston <jeremyhu@freedesktop.org>2008-09-03 09:33:39 -0700
commit9e70a3cf58c205948f6a415e203d825e9b660d9d (patch)
tree799666247980ac56fb00d6d87919e4d9d67a5c68 /mi
parent700e8bf33f9b1c3921de912b8110fadf5e0626da (diff)
mieqProcessInputEvents: Check custom event handlers first.
Diffstat (limited to 'mi')
-rw-r--r--mi/mieq.c29
1 files changed, 13 insertions, 16 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index e7e16ab5a..48628fc89 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -315,10 +315,21 @@ mieqProcessInputEvents(void)
#endif
e = &miEventQueue.events[miEventQueue.head];
- /* Assumption - screen switching can only occur on motion events. */
miEventQueue.head = (miEventQueue.head + 1) % QUEUE_SIZE;
- if (e->pScreen != DequeueScreen(e->pDev)) {
+ if ((handler = miEventQueue.handlers[e->events->event->u.u.type]))
+ {
+ /* If someone's registered a custom event handler, let them
+ * steal it. */
+ handler(DequeueScreen(e->pDev)->myNum, e->events->event,
+ e->pDev, e->nevents);
+ if (!e->pDev->isMaster && e->pDev->u.master)
+ {
+ handler(DequeueScreen(e->pDev->u.master)->myNum,
+ e->events->event, e->pDev->u.master, e->nevents);
+ }
+ } else if (e->pScreen != DequeueScreen(e->pDev)) {
+ /* Assumption - screen switching can only occur on motion events. */
DequeueScreen(e->pDev) = e->pScreen;
x = e->events[0].event->u.keyButtonPointer.rootX;
y = e->events[0].event->u.keyButtonPointer.rootY;
@@ -353,19 +364,6 @@ mieqProcessInputEvents(void)
} else
master_event = NULL;
- /* If someone's registered a custom event handler, let them
- * steal it. */
- if ((handler = miEventQueue.handlers[e->events->event->u.u.type]))
- {
- handler(DequeueScreen(e->pDev)->myNum, e->events->event,
- e->pDev, e->nevents);
- if (!e->pDev->isMaster && e->pDev->u.master)
- {
- handler(DequeueScreen(e->pDev->u.master)->myNum,
- e->events->event, e->pDev->u.master, e->nevents);
- }
- } else
- {
/* process slave first, then master */
e->pDev->public.processInputProc(event, e->pDev, e->nevents);
@@ -374,7 +372,6 @@ mieqProcessInputEvents(void)
e->pDev->u.master->public.processInputProc(master_event,
e->pDev->u.master, e->nevents);
}
- }
if (e->nevents > 1)
xfree(event);