From ff36753755360aaa16ab8604a0ab78123884b57d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 29 Apr 2008 14:53:41 +0930 Subject: mi: call the custom event handlers for both MD and SD. --- mi/mieq.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'mi') diff --git a/mi/mieq.c b/mi/mieq.c index 082ebab91..9f818677b 100644 --- a/mi/mieq.c +++ b/mi/mieq.c @@ -313,16 +313,7 @@ mieqProcessInputEvents(void) NewCurrentScreen (e->pDev, DequeueScreen(e->pDev), x, y); } else { - /* If someone's registered a custom event handler, let them - * steal it. */ - if (miEventQueue.handlers[e->events->event->u.u.type]) { - miEventQueue.handlers[e->events->event->u.u.type]( - DequeueScreen(e->pDev)->myNum, - e->events->event, - e->pDev, - e->nevents); - return; - } + mieqHandler handler; /* FIXME: Bad hack. The only event where we actually get multiple * events at once is a DeviceMotionNotify followed by @@ -350,13 +341,27 @@ mieqProcessInputEvents(void) } else master_event = NULL; - /* process slave first, then master */ - e->pDev->public.processInputProc(event, e->pDev, e->nevents); - - if (!e->pDev->isMaster && e->pDev->u.master) + /* If someone's registered a custom event handler, let them + * steal it. */ + if ((handler = miEventQueue.handlers[e->events->event->u.u.type])) { - e->pDev->u.master->public.processInputProc(master_event, - e->pDev->u.master, e->nevents); + 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); + + if (!e->pDev->isMaster && e->pDev->u.master) + { + e->pDev->u.master->public.processInputProc(master_event, + e->pDev->u.master, e->nevents); + } } if (e->nevents > 1) -- cgit v1.2.3