diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-04-15 10:07:10 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-05-11 14:27:36 +1000 |
commit | 20fb07f436f7d4a0f330b2067a93a5a4829fccf5 (patch) | |
tree | bd792a68e16770fd02208b9d334bbfeea24be330 /hw | |
parent | 8670c46bdfdade64e63119d2ebbd5ef63b6fa2c3 (diff) |
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 <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/dmx/input/dmxevents.c | 28 | ||||
-rw-r--r-- | hw/kdrive/src/kinput.c | 11 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Events.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Init.c | 2 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Priv.h | 3 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 11 | ||||
-rw-r--r-- | hw/xnest/Events.c | 14 | ||||
-rw-r--r-- | hw/xnest/Init.c | 4 | ||||
-rw-r--r-- | hw/xquartz/darwinEvents.c | 7 | ||||
-rw-r--r-- | hw/xwin/winkeybd.c | 3 | ||||
-rw-r--r-- | hw/xwin/winmouse.c | 8 |
11 files changed, 27 insertions, 66 deletions
diff --git a/hw/dmx/input/dmxevents.c b/hw/dmx/input/dmxevents.c index 8aa1b8036..41bc4bf2d 100644 --- a/hw/dmx/input/dmxevents.c +++ b/hw/dmx/input/dmxevents.c @@ -177,15 +177,13 @@ static void enqueueMotion(DevicePtr pDev, int x, int y) GETDMXLOCALFROMPDEV; DeviceIntPtr p = dmxLocal->pDevice; int valuators[3]; - InternalEvent* events; int detail = 0; /* XXX should this be mask of pressed buttons? */ ValuatorMask mask; valuators[0] = x; valuators[1] = y; valuator_mask_set_range(&mask, 0, 2, valuators); - GetEventList(&events); - QueuePointerEvents(events, p, MotionNotify, detail, + QueuePointerEvents(p, MotionNotify, detail, POINTER_ABSOLUTE | POINTER_SCREEN, &mask); return; } @@ -290,7 +288,6 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, int thisX = 0; int thisY = 0; int count; - InternalEvent* events; ValuatorMask mask; memset(xE, 0, sizeof(xE)); @@ -372,8 +369,7 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, if (block) dmxSigioBlock(); valuator_mask_set_range(&mask, firstAxis, axesCount, v); - GetEventList(&events); - QueuePointerEvents(events, pDevice, MotionNotify, 0, + QueuePointerEvents(pDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask); if (block) @@ -389,7 +385,6 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, XDeviceMotionEvent *me = (XDeviceMotionEvent *)e; DeviceIntPtr pDevice = dmxLocal->pDevice; int valuators[MAX_VALUATORS]; - InternalEvent* events; ValuatorMask mask; if (!e) @@ -446,8 +441,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) dmxSigioBlock(); - GetEventList(&events); - QueueKeyboardEvents(events, pDevice, event, ke->keycode, &mask); + QueueKeyboardEvents(pDevice, event, ke->keycode, &mask); if (block) dmxSigioUnblock(); break; @@ -457,8 +451,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) dmxSigioBlock(); - GetEventList(&events); - QueuePointerEvents(events, pDevice, event, ke->keycode, + QueuePointerEvents(pDevice, event, ke->keycode, POINTER_ABSOLUTE, &mask); if (block) dmxSigioUnblock(); @@ -469,8 +462,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) dmxSigioBlock(); - GetEventList(&events); - QueueProximityEvents(events, pDevice, event, &mask); + QueueProximityEvents(pDevice, event, &mask); if (block) dmxSigioUnblock(); break; @@ -652,7 +644,6 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, xEvent xE; DeviceIntPtr p = dmxLocal->pDevice; int valuators[3]; - InternalEvent* events; ValuatorMask mask; DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail); @@ -667,27 +658,24 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym, if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard) xE.u.u.detail = dmxFixup(pDev, detail, keySym); - GetEventList(&events); /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/ - QueueKeyboardEvents(events, p, type, detail, NULL); + QueueKeyboardEvents(p, type, detail, NULL); return; case ButtonPress: case ButtonRelease: detail = dmxGetButtonMapping(dmxLocal, detail); valuator_mask_zero(&mask); - GetEventList(&events); - QueuePointerEvents(events, p, type, detail, + QueuePointerEvents(p, type, detail, POINTER_ABSOLUTE | POINTER_SCREEN, &mask); return; case MotionNotify: - GetEventList(&events); valuators[0] = e->xmotion.x; valuators[1] = e->xmotion.y; valuators[2] = e->xmotion.state; /* FIXME: WTF?? */ valuator_mask_set_range(&mask, 0, 3, valuators); - QueuePointerEvents(events, p, type, detail, + QueuePointerEvents(p, type, detail, POINTER_ABSOLUTE | POINTER_SCREEN, &mask); return; diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 62e8f7866..cdf55d7f9 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -66,8 +66,6 @@ static struct KdConfigDevice *kdConfigPointers = NULL; static KdKeyboardDriver *kdKeyboardDrivers = NULL; static KdPointerDriver *kdPointerDrivers = NULL; -static InternalEvent* kdEvents = NULL; - static Bool kdInputEnabled; static Bool kdOffScreen; static unsigned long kdOffScreenTime; @@ -1803,8 +1801,7 @@ KdReleaseAllKeys (void) key++) { if (key_is_down(ki->dixdev, key, KEY_POSTED | KEY_PROCESSED)) { KdHandleKeyboardEvent(ki, KeyRelease, key); - GetEventList(&kdEvents); - QueueGetKeyboardEvents(kdEvents, ki->dixdev, KeyRelease, key, NULL); + QueueGetKeyboardEvents(ki->dixdev, KeyRelease, key, NULL); } } } @@ -1860,8 +1857,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki, else type = KeyPress; - GetEventList(&kdEvents); - QueueKeyboardEvents(kdEvents, ki->dixdev, type, key_code, NULL); + QueueKeyboardEvents(ki->dixdev, type, key_code, NULL); } else { ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n", @@ -1969,8 +1965,7 @@ _KdEnqueuePointerEvent (KdPointerInfo *pi, int type, int x, int y, int z, valuator_mask_set_range(&mask, 0, 3, valuators); - GetEventList(&kdEvents); - QueuePointerEvents(kdEvents, pi->dixdev, type, b, absrel, &mask); + QueuePointerEvents(pi->dixdev, type, b, absrel, &mask); } void diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 6402d72b3..c4a4db9be 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -399,7 +399,7 @@ xf86ReleaseKeys(DeviceIntPtr pDev) i++) { if (key_is_down(pDev, i, KEY_POSTED)) { sigstate = xf86BlockSIGIO (); - QueueKeyboardEvents(xf86Events, pDev, KeyRelease, i, NULL); + QueueKeyboardEvents(pDev, KeyRelease, i, NULL); xf86UnblockSIGIO(sigstate); } } diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index 0b36163c0..53f763aaf 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -806,8 +806,6 @@ InitInput(int argc, char **argv) mieqInit(); - GetEventList(&xf86Events); - /* Initialize all configured input devices */ for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { /* Replace obsolete keyboard driver with kbd */ diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 015e12c3f..5d91ab367 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -148,9 +148,6 @@ extern _X_EXPORT int xf86SetVerbosity(int verb); extern _X_EXPORT int xf86SetLogVerbosity(int verb); extern _X_EXPORT Bool xf86CallDriverProbe( struct _DriverRec * drv, Bool detect_only ); -/* xf86Xinput.c */ -extern _X_EXPORT InternalEvent *xf86Events; - #endif /* _NO_XF86_PROTOTYPES */ diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 9827661d6..e7e1ce1f0 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -99,8 +99,6 @@ return; \ } -InternalEvent* xf86Events = NULL; - static int xf86InputDevicePostInit(DeviceIntPtr dev); @@ -1049,7 +1047,7 @@ xf86PostMotionEventM(DeviceIntPtr device, } #endif - QueuePointerEvents(xf86Events, device, MotionNotify, 0, flags, mask); + QueuePointerEvents(device, MotionNotify, 0, flags, mask); } void @@ -1094,8 +1092,7 @@ xf86PostProximityEventM(DeviceIntPtr device, int is_in, const ValuatorMask *mask) { - QueueProximityEvents(xf86Events, device, - is_in ? ProximityIn : ProximityOut, mask); + QueueProximityEvents(device, is_in ? ProximityIn : ProximityOut, mask); } void @@ -1166,7 +1163,7 @@ xf86PostButtonEventM(DeviceIntPtr device, } #endif - QueuePointerEvents(xf86Events, device, + QueuePointerEvents(device, is_down ? ButtonPress : ButtonRelease, button, flags, mask); } @@ -1233,7 +1230,7 @@ xf86PostKeyEventM(DeviceIntPtr device, } #endif - QueueKeyboardEvents(xf86Events, device, + QueueKeyboardEvents(device, is_down ? KeyPress : KeyRelease, key_code, mask); } 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)); diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index 6736e3d69..fe744b741 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -485,8 +485,7 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa darwinEvents_lock(); { ValuatorMask mask; valuator_mask_set_range(&mask, 0, (pDev == darwinPointer) ? 2 : 5, valuators); - QueuePointerEvents(darwinEvents, pDev, ev_type, ev_button, - POINTER_ABSOLUTE, &mask); + QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, &mask); DarwinPokeEQ(); } darwinEvents_unlock(); } @@ -499,7 +498,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) { } darwinEvents_lock(); { - QueueKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE, NULL); + QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE, NULL); DarwinPokeEQ(); } darwinEvents_unlock(); } @@ -526,7 +525,7 @@ void DarwinSendProximityEvents(DeviceIntPtr pDev, int ev_type, float pointer_x, darwinEvents_lock(); { ValuatorMask mask; valuator_mask_set_range(&mask, 0, 5, valuators); - QueueProximityEvents(darwinEvents, pDev, ev_type, &mask); + QueueProximityEvents(pDev, ev_type, &mask); DarwinPokeEQ(); } darwinEvents_unlock(); } diff --git a/hw/xwin/winkeybd.c b/hw/xwin/winkeybd.c index 8b6be0266..2fa6b3f6e 100644 --- a/hw/xwin/winkeybd.c +++ b/hw/xwin/winkeybd.c @@ -483,8 +483,7 @@ winSendKeyEvent (DWORD dwKey, Bool fDown) /* Update the keyState map */ g_winKeyState[dwKey] = fDown; - GetEventList(&events); - QueueKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL); + QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL); winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", dwKey, fDown, nevents); diff --git a/hw/xwin/winmouse.c b/hw/xwin/winmouse.c index aaa4d4b99..b1b0657cf 100644 --- a/hw/xwin/winmouse.c +++ b/hw/xwin/winmouse.c @@ -234,15 +234,13 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ) void winMouseButtonsSendEvent (int iEventType, int iButton) { - InternalEvent* events; ValuatorMask mask; if (g_winMouseButtonMap) iButton = g_winMouseButtonMap[iButton]; valuator_mask_zero(&mask); - GetEventList(&events); - QueuePointerEvents(events, g_pwinPointer, iEventType, iButton, + QueuePointerEvents(g_pwinPointer, iEventType, iButton, POINTER_RELATIVE, &mask); #if CYGDEBUG @@ -365,15 +363,13 @@ void winEnqueueMotion(int x, int y) { int valuators[2]; ValuatorMask mask; - InternalEvent* events; miPointerSetPosition(g_pwinPointer, POINTER_RELATIVE, &x, &y); valuators[0] = x; valuators[1] = y; valuator_mask_set_range(&mask, 0, 2, valuators); - GetEventList(&events); - QueuePointerEvents(events, g_pwinPointer, MotionNotify, 0, + QueuePointerEvents(g_pwinPointer, MotionNotify, 0, POINTER_ABSOLUTE | POINTER_SCREEN, &mask); } |