From 20fb07f436f7d4a0f330b2067a93a5a4829fccf5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 15 Apr 2011 10:07:10 +1000 Subject: input: remove DDX event list handling The current approach to event posting required the DDX to request the event list (allocated by the DIX) and then pass that list into QueuePointerEvent and friends. Remove this step and use the DIX event list directly. This means that QueuePointerEvent is not reentrant but it wasn't before anyway. Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston --- hw/xnest/Events.c | 14 +++++--------- hw/xnest/Init.c | 4 ---- 2 files changed, 5 insertions(+), 13 deletions(-) (limited to 'hw/xnest') diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c index bbd70bf03..619427ded 100644 --- a/hw/xnest/Events.c +++ b/hw/xnest/Events.c @@ -43,8 +43,6 @@ is" without express or implied warranty. CARD32 lastEventTime = 0; -extern InternalEvent *xnestEvents; - void ProcessInputEvents(void) { @@ -104,9 +102,8 @@ xnestCollectExposures(void) void xnestQueueKeyEvent(int type, unsigned int keycode) { - GetEventList(&xnestEvents); lastEventTime = GetTimeInMillis(); - QueueKeyboardEvents(xnestEvents, xnestKeyboardDevice, type, keycode, NULL); + QueueKeyboardEvents(xnestKeyboardDevice, type, keycode, NULL); } void @@ -116,7 +113,6 @@ xnestCollectEvents(void) int valuators[2]; ValuatorMask mask; ScreenPtr pScreen; - GetEventList(&xnestEvents); while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) { switch (X.type) { @@ -134,7 +130,7 @@ xnestCollectEvents(void) valuator_mask_set_range(&mask, 0, 0, NULL); xnestUpdateModifierState(X.xkey.state); lastEventTime = GetTimeInMillis(); - QueuePointerEvents(xnestEvents, xnestPointerDevice, ButtonPress, + QueuePointerEvents(xnestPointerDevice, ButtonPress, X.xbutton.button, POINTER_RELATIVE, &mask); break; @@ -142,7 +138,7 @@ xnestCollectEvents(void) valuator_mask_set_range(&mask, 0, 0, NULL); xnestUpdateModifierState(X.xkey.state); lastEventTime = GetTimeInMillis(); - QueuePointerEvents(xnestEvents, xnestPointerDevice, ButtonRelease, + QueuePointerEvents(xnestPointerDevice, ButtonRelease, X.xbutton.button, POINTER_RELATIVE, &mask); break; @@ -151,7 +147,7 @@ xnestCollectEvents(void) valuators[1] = X.xmotion.y; valuator_mask_set_range(&mask, 0, 2, valuators); lastEventTime = GetTimeInMillis(); - QueuePointerEvents(xnestEvents, xnestPointerDevice, MotionNotify, + QueuePointerEvents(xnestPointerDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask); break; @@ -183,7 +179,7 @@ xnestCollectEvents(void) valuators[1] = X.xcrossing.y; valuator_mask_set_range(&mask, 0, 2, valuators); lastEventTime = GetTimeInMillis(); - QueuePointerEvents(xnestEvents, xnestPointerDevice, MotionNotify, + QueuePointerEvents(xnestPointerDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask); xnestDirectInstallColormaps(pScreen); } diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index f8637f2ab..ee74101d2 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -45,8 +45,6 @@ is" without express or implied warranty. Bool xnestDoFullGeneration = True; -InternalEvent *xnestEvents = NULL; - void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) { @@ -100,8 +98,6 @@ InitInput(int argc, char *argv[]) if (rc != Success) FatalError("Failed to init Xnest default devices.\n"); - GetEventList(&xnestEvents); - mieqInit(); AddEnabledDevice(XConnectionNumber(xnestDisplay)); -- cgit v1.2.3