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>
This commit is contained in:
Peter Hutterer 2011-04-15 10:07:10 +10:00
parent 8670c46bdf
commit 20fb07f436
14 changed files with 46 additions and 101 deletions

View File

@ -5035,8 +5035,7 @@ InitEvents(void)
DontPropagateRefCnts[i] = 0; DontPropagateRefCnts[i] = 0;
} }
InputEventListLen = GetMaximumEventsNum(); InputEventList = InitEventList(GetMaximumEventsNum());
InputEventList = InitEventList(InputEventListLen);
if (!InputEventList) if (!InputEventList)
FatalError("[dix] Failed to allocate input event list.\n"); FatalError("[dix] Failed to allocate input event list.\n");
} }
@ -5044,8 +5043,7 @@ InitEvents(void)
void void
CloseDownEvents(void) CloseDownEvents(void)
{ {
FreeEventList(InputEventList, InputEventListLen); FreeEventList(InputEventList, GetMaximumEventsNum());
InputEventListLen = 0;
InputEventList = NULL; InputEventList = NULL;
} }

View File

@ -68,19 +68,12 @@
/* Number of motion history events to store. */ /* Number of motion history events to store. */
#define MOTION_HISTORY_SIZE 256 #define MOTION_HISTORY_SIZE 256
/* InputEventList is the storage for input events generated by the /**
* DDX. The DDX is expected to call GetEventList() and then pass the list into * InputEventList is the storage for input events generated by
* Get{Pointer|Keyboard}Events. * QueuePointerEvents, QueueKeyboardEvents, and QueueProximityEvents.
* This list is allocated on startup by the DIX.
*/ */
InternalEvent* InputEventList = NULL; InternalEvent* InputEventList = NULL;
int InputEventListLen = 0;
int
GetEventList(InternalEvent** list)
{
*list = InputEventList;
return InputEventListLen;
}
/** /**
* Pick some arbitrary size for Xi motion history. * Pick some arbitrary size for Xi motion history.
@ -937,10 +930,10 @@ queueEventList(DeviceIntPtr device, InternalEvent *events, int nevents)
* Generate internal events representing this keyboard event and enqueue * Generate internal events representing this keyboard event and enqueue
* them on the event queue. * them on the event queue.
* *
* FIXME: don't require the event list to be passed in. * This function is not reentrant. Disable signals before calling.
*
* FIXME: flags for relative/abs motion? * FIXME: flags for relative/abs motion?
* *
* @param events Event list used as temporary storage
* @param device The device to generate the event for * @param device The device to generate the event for
* @param type Event type, one of KeyPress or KeyRelease * @param type Event type, one of KeyPress or KeyRelease
* @param keycode Key code of the pressed/released key * @param keycode Key code of the pressed/released key
@ -948,13 +941,13 @@ queueEventList(DeviceIntPtr device, InternalEvent *events, int nevents)
* *
*/ */
void void
QueueKeyboardEvents(InternalEvent *events, DeviceIntPtr device, int type, QueueKeyboardEvents(DeviceIntPtr device, int type,
int keycode, const ValuatorMask *mask) int keycode, const ValuatorMask *mask)
{ {
int nevents; int nevents;
nevents = GetKeyboardEvents(events, device, type, keycode, mask); nevents = GetKeyboardEvents(InputEventList, device, type, keycode, mask);
queueEventList(device, events, nevents); queueEventList(device, InputEventList, nevents);
} }
/** /**
@ -1074,9 +1067,8 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask, int *x, int *y)
* Generate internal events representing this pointer event and enqueue them * Generate internal events representing this pointer event and enqueue them
* on the event queue. * on the event queue.
* *
* FIXME: don't require the event list to be passed in. * This function is not reentrant. Disable signals before calling.
* *
* @param events Set of events list used as temporary storage
* @param device The device to generate the event for * @param device The device to generate the event for
* @param type Event type, one of ButtonPress, ButtonRelease, MotionNotify * @param type Event type, one of ButtonPress, ButtonRelease, MotionNotify
* @param buttons Button number of the buttons modified. Must be 0 for * @param buttons Button number of the buttons modified. Must be 0 for
@ -1085,13 +1077,13 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask, int *x, int *y)
* @param mask Valuator mask for valuators present for this event. * @param mask Valuator mask for valuators present for this event.
*/ */
void void
QueuePointerEvents(InternalEvent *events, DeviceIntPtr device, int type, QueuePointerEvents(DeviceIntPtr device, int type,
int buttons, int flags, const ValuatorMask *mask) int buttons, int flags, const ValuatorMask *mask)
{ {
int nevents; int nevents;
nevents = GetPointerEvents(events, device, type, buttons, flags, mask); nevents = GetPointerEvents(InputEventList, device, type, buttons, flags, mask);
queueEventList(device, events, nevents); queueEventList(device, InputEventList, nevents);
} }
/** /**
@ -1252,9 +1244,8 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
* Generate internal events representing this proximity event and enqueue * Generate internal events representing this proximity event and enqueue
* them on the event queue. * them on the event queue.
* *
* FIXME: don't require the event list to be passed in. * This function is not reentrant. Disable signals before calling.
* *
* @param events Event list used as temporary storage
* @param device The device to generate the event for * @param device The device to generate the event for
* @param type Event type, one of ProximityIn or ProximityOut * @param type Event type, one of ProximityIn or ProximityOut
* @param keycode Key code of the pressed/released key * @param keycode Key code of the pressed/released key
@ -1262,13 +1253,13 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
* *
*/ */
void void
QueueProximityEvents(InternalEvent *events, DeviceIntPtr device, int type, QueueProximityEvents(DeviceIntPtr device, int type,
const ValuatorMask *mask) const ValuatorMask *mask)
{ {
int nevents; int nevents;
nevents = GetProximityEvents(events, device, type, mask); nevents = GetProximityEvents(InputEventList, device, type, mask);
queueEventList(device, events, nevents); queueEventList(device, InputEventList, nevents);
} }
/** /**

View File

@ -177,15 +177,13 @@ static void enqueueMotion(DevicePtr pDev, int x, int y)
GETDMXLOCALFROMPDEV; GETDMXLOCALFROMPDEV;
DeviceIntPtr p = dmxLocal->pDevice; DeviceIntPtr p = dmxLocal->pDevice;
int valuators[3]; int valuators[3];
InternalEvent* events;
int detail = 0; /* XXX should this be mask of pressed buttons? */ int detail = 0; /* XXX should this be mask of pressed buttons? */
ValuatorMask mask; ValuatorMask mask;
valuators[0] = x; valuators[0] = x;
valuators[1] = y; valuators[1] = y;
valuator_mask_set_range(&mask, 0, 2, valuators); valuator_mask_set_range(&mask, 0, 2, valuators);
GetEventList(&events); QueuePointerEvents(p, MotionNotify, detail,
QueuePointerEvents(events, p, MotionNotify, detail,
POINTER_ABSOLUTE | POINTER_SCREEN, &mask); POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
return; return;
} }
@ -290,7 +288,6 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
int thisX = 0; int thisX = 0;
int thisY = 0; int thisY = 0;
int count; int count;
InternalEvent* events;
ValuatorMask mask; ValuatorMask mask;
memset(xE, 0, sizeof(xE)); memset(xE, 0, sizeof(xE));
@ -372,8 +369,7 @@ static void dmxExtMotion(DMXLocalInputInfoPtr dmxLocal,
if (block) if (block)
dmxSigioBlock(); dmxSigioBlock();
valuator_mask_set_range(&mask, firstAxis, axesCount, v); valuator_mask_set_range(&mask, firstAxis, axesCount, v);
GetEventList(&events); QueuePointerEvents(pDevice, MotionNotify, 0,
QueuePointerEvents(events, pDevice, MotionNotify, 0,
POINTER_ABSOLUTE, &mask); POINTER_ABSOLUTE, &mask);
if (block) if (block)
@ -389,7 +385,6 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
XDeviceMotionEvent *me = (XDeviceMotionEvent *)e; XDeviceMotionEvent *me = (XDeviceMotionEvent *)e;
DeviceIntPtr pDevice = dmxLocal->pDevice; DeviceIntPtr pDevice = dmxLocal->pDevice;
int valuators[MAX_VALUATORS]; int valuators[MAX_VALUATORS];
InternalEvent* events;
ValuatorMask mask; ValuatorMask mask;
if (!e) if (!e)
@ -446,8 +441,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
if (block) if (block)
dmxSigioBlock(); dmxSigioBlock();
GetEventList(&events); QueueKeyboardEvents(pDevice, event, ke->keycode, &mask);
QueueKeyboardEvents(events, pDevice, event, ke->keycode, &mask);
if (block) if (block)
dmxSigioUnblock(); dmxSigioUnblock();
break; break;
@ -457,8 +451,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
if (block) if (block)
dmxSigioBlock(); dmxSigioBlock();
GetEventList(&events); QueuePointerEvents(pDevice, event, ke->keycode,
QueuePointerEvents(events, pDevice, event, ke->keycode,
POINTER_ABSOLUTE, &mask); POINTER_ABSOLUTE, &mask);
if (block) if (block)
dmxSigioUnblock(); dmxSigioUnblock();
@ -469,8 +462,7 @@ static int dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal,
valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators);
if (block) if (block)
dmxSigioBlock(); dmxSigioBlock();
GetEventList(&events); QueueProximityEvents(pDevice, event, &mask);
QueueProximityEvents(events, pDevice, event, &mask);
if (block) if (block)
dmxSigioUnblock(); dmxSigioUnblock();
break; break;
@ -652,7 +644,6 @@ void dmxEnqueue(DevicePtr pDev, int type, int detail, KeySym keySym,
xEvent xE; xEvent xE;
DeviceIntPtr p = dmxLocal->pDevice; DeviceIntPtr p = dmxLocal->pDevice;
int valuators[3]; int valuators[3];
InternalEvent* events;
ValuatorMask mask; ValuatorMask mask;
DMXDBG2("dmxEnqueue: Enqueuing type=%d detail=0x%0x\n", type, detail); 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) if (dmxLocal->sendsCore && dmxLocal != dmxLocalCoreKeyboard)
xE.u.u.detail = dmxFixup(pDev, detail, keySym); xE.u.u.detail = dmxFixup(pDev, detail, keySym);
GetEventList(&events);
/*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/ /*ErrorF("KEY %d sym %d\n", detail, (int) keySym);*/
QueueKeyboardEvents(events, p, type, detail, NULL); QueueKeyboardEvents(p, type, detail, NULL);
return; return;
case ButtonPress: case ButtonPress:
case ButtonRelease: case ButtonRelease:
detail = dmxGetButtonMapping(dmxLocal, detail); detail = dmxGetButtonMapping(dmxLocal, detail);
valuator_mask_zero(&mask); valuator_mask_zero(&mask);
GetEventList(&events); QueuePointerEvents(p, type, detail,
QueuePointerEvents(events, p, type, detail,
POINTER_ABSOLUTE | POINTER_SCREEN, &mask); POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
return; return;
case MotionNotify: case MotionNotify:
GetEventList(&events);
valuators[0] = e->xmotion.x; valuators[0] = e->xmotion.x;
valuators[1] = e->xmotion.y; valuators[1] = e->xmotion.y;
valuators[2] = e->xmotion.state; /* FIXME: WTF?? */ valuators[2] = e->xmotion.state; /* FIXME: WTF?? */
valuator_mask_set_range(&mask, 0, 3, valuators); valuator_mask_set_range(&mask, 0, 3, valuators);
QueuePointerEvents(events, p, type, detail, QueuePointerEvents(p, type, detail,
POINTER_ABSOLUTE | POINTER_SCREEN, &mask); POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
return; return;

View File

@ -66,8 +66,6 @@ static struct KdConfigDevice *kdConfigPointers = NULL;
static KdKeyboardDriver *kdKeyboardDrivers = NULL; static KdKeyboardDriver *kdKeyboardDrivers = NULL;
static KdPointerDriver *kdPointerDrivers = NULL; static KdPointerDriver *kdPointerDrivers = NULL;
static InternalEvent* kdEvents = NULL;
static Bool kdInputEnabled; static Bool kdInputEnabled;
static Bool kdOffScreen; static Bool kdOffScreen;
static unsigned long kdOffScreenTime; static unsigned long kdOffScreenTime;
@ -1803,8 +1801,7 @@ KdReleaseAllKeys (void)
key++) { key++) {
if (key_is_down(ki->dixdev, key, KEY_POSTED | KEY_PROCESSED)) { if (key_is_down(ki->dixdev, key, KEY_POSTED | KEY_PROCESSED)) {
KdHandleKeyboardEvent(ki, KeyRelease, key); KdHandleKeyboardEvent(ki, KeyRelease, key);
GetEventList(&kdEvents); QueueGetKeyboardEvents(ki->dixdev, KeyRelease, key, NULL);
QueueGetKeyboardEvents(kdEvents, ki->dixdev, KeyRelease, key, NULL);
} }
} }
} }
@ -1860,8 +1857,7 @@ KdEnqueueKeyboardEvent(KdKeyboardInfo *ki,
else else
type = KeyPress; type = KeyPress;
GetEventList(&kdEvents); QueueKeyboardEvents(ki->dixdev, type, key_code, NULL);
QueueKeyboardEvents(kdEvents, ki->dixdev, type, key_code, NULL);
} }
else { else {
ErrorF("driver %s wanted to post scancode %d outside of [%d, %d]!\n", 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); valuator_mask_set_range(&mask, 0, 3, valuators);
GetEventList(&kdEvents); QueuePointerEvents(pi->dixdev, type, b, absrel, &mask);
QueuePointerEvents(kdEvents, pi->dixdev, type, b, absrel, &mask);
} }
void void

View File

@ -399,7 +399,7 @@ xf86ReleaseKeys(DeviceIntPtr pDev)
i++) { i++) {
if (key_is_down(pDev, i, KEY_POSTED)) { if (key_is_down(pDev, i, KEY_POSTED)) {
sigstate = xf86BlockSIGIO (); sigstate = xf86BlockSIGIO ();
QueueKeyboardEvents(xf86Events, pDev, KeyRelease, i, NULL); QueueKeyboardEvents(pDev, KeyRelease, i, NULL);
xf86UnblockSIGIO(sigstate); xf86UnblockSIGIO(sigstate);
} }
} }

View File

@ -806,8 +806,6 @@ InitInput(int argc, char **argv)
mieqInit(); mieqInit();
GetEventList(&xf86Events);
/* Initialize all configured input devices */ /* Initialize all configured input devices */
for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) { for (pDev = xf86ConfigLayout.inputs; pDev && *pDev; pDev++) {
/* Replace obsolete keyboard driver with kbd */ /* Replace obsolete keyboard driver with kbd */

View File

@ -148,9 +148,6 @@ extern _X_EXPORT int xf86SetVerbosity(int verb);
extern _X_EXPORT int xf86SetLogVerbosity(int verb); extern _X_EXPORT int xf86SetLogVerbosity(int verb);
extern _X_EXPORT Bool xf86CallDriverProbe( struct _DriverRec * drv, Bool detect_only ); extern _X_EXPORT Bool xf86CallDriverProbe( struct _DriverRec * drv, Bool detect_only );
/* xf86Xinput.c */
extern _X_EXPORT InternalEvent *xf86Events;
#endif /* _NO_XF86_PROTOTYPES */ #endif /* _NO_XF86_PROTOTYPES */

View File

@ -99,8 +99,6 @@
return; \ return; \
} }
InternalEvent* xf86Events = NULL;
static int static int
xf86InputDevicePostInit(DeviceIntPtr dev); xf86InputDevicePostInit(DeviceIntPtr dev);
@ -1049,7 +1047,7 @@ xf86PostMotionEventM(DeviceIntPtr device,
} }
#endif #endif
QueuePointerEvents(xf86Events, device, MotionNotify, 0, flags, mask); QueuePointerEvents(device, MotionNotify, 0, flags, mask);
} }
void void
@ -1094,8 +1092,7 @@ xf86PostProximityEventM(DeviceIntPtr device,
int is_in, int is_in,
const ValuatorMask *mask) const ValuatorMask *mask)
{ {
QueueProximityEvents(xf86Events, device, QueueProximityEvents(device, is_in ? ProximityIn : ProximityOut, mask);
is_in ? ProximityIn : ProximityOut, mask);
} }
void void
@ -1166,7 +1163,7 @@ xf86PostButtonEventM(DeviceIntPtr device,
} }
#endif #endif
QueuePointerEvents(xf86Events, device, QueuePointerEvents(device,
is_down ? ButtonPress : ButtonRelease, button, is_down ? ButtonPress : ButtonRelease, button,
flags, mask); flags, mask);
} }
@ -1233,7 +1230,7 @@ xf86PostKeyEventM(DeviceIntPtr device,
} }
#endif #endif
QueueKeyboardEvents(xf86Events, device, QueueKeyboardEvents(device,
is_down ? KeyPress : KeyRelease, is_down ? KeyPress : KeyRelease,
key_code, mask); key_code, mask);
} }

View File

@ -43,8 +43,6 @@ is" without express or implied warranty.
CARD32 lastEventTime = 0; CARD32 lastEventTime = 0;
extern InternalEvent *xnestEvents;
void void
ProcessInputEvents(void) ProcessInputEvents(void)
{ {
@ -104,9 +102,8 @@ xnestCollectExposures(void)
void void
xnestQueueKeyEvent(int type, unsigned int keycode) xnestQueueKeyEvent(int type, unsigned int keycode)
{ {
GetEventList(&xnestEvents);
lastEventTime = GetTimeInMillis(); lastEventTime = GetTimeInMillis();
QueueKeyboardEvents(xnestEvents, xnestKeyboardDevice, type, keycode, NULL); QueueKeyboardEvents(xnestKeyboardDevice, type, keycode, NULL);
} }
void void
@ -116,7 +113,6 @@ xnestCollectEvents(void)
int valuators[2]; int valuators[2];
ValuatorMask mask; ValuatorMask mask;
ScreenPtr pScreen; ScreenPtr pScreen;
GetEventList(&xnestEvents);
while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) { while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) {
switch (X.type) { switch (X.type) {
@ -134,7 +130,7 @@ xnestCollectEvents(void)
valuator_mask_set_range(&mask, 0, 0, NULL); valuator_mask_set_range(&mask, 0, 0, NULL);
xnestUpdateModifierState(X.xkey.state); xnestUpdateModifierState(X.xkey.state);
lastEventTime = GetTimeInMillis(); lastEventTime = GetTimeInMillis();
QueuePointerEvents(xnestEvents, xnestPointerDevice, ButtonPress, QueuePointerEvents(xnestPointerDevice, ButtonPress,
X.xbutton.button, POINTER_RELATIVE, &mask); X.xbutton.button, POINTER_RELATIVE, &mask);
break; break;
@ -142,7 +138,7 @@ xnestCollectEvents(void)
valuator_mask_set_range(&mask, 0, 0, NULL); valuator_mask_set_range(&mask, 0, 0, NULL);
xnestUpdateModifierState(X.xkey.state); xnestUpdateModifierState(X.xkey.state);
lastEventTime = GetTimeInMillis(); lastEventTime = GetTimeInMillis();
QueuePointerEvents(xnestEvents, xnestPointerDevice, ButtonRelease, QueuePointerEvents(xnestPointerDevice, ButtonRelease,
X.xbutton.button, POINTER_RELATIVE, &mask); X.xbutton.button, POINTER_RELATIVE, &mask);
break; break;
@ -151,7 +147,7 @@ xnestCollectEvents(void)
valuators[1] = X.xmotion.y; valuators[1] = X.xmotion.y;
valuator_mask_set_range(&mask, 0, 2, valuators); valuator_mask_set_range(&mask, 0, 2, valuators);
lastEventTime = GetTimeInMillis(); lastEventTime = GetTimeInMillis();
QueuePointerEvents(xnestEvents, xnestPointerDevice, MotionNotify, QueuePointerEvents(xnestPointerDevice, MotionNotify,
0, POINTER_ABSOLUTE, &mask); 0, POINTER_ABSOLUTE, &mask);
break; break;
@ -183,7 +179,7 @@ xnestCollectEvents(void)
valuators[1] = X.xcrossing.y; valuators[1] = X.xcrossing.y;
valuator_mask_set_range(&mask, 0, 2, valuators); valuator_mask_set_range(&mask, 0, 2, valuators);
lastEventTime = GetTimeInMillis(); lastEventTime = GetTimeInMillis();
QueuePointerEvents(xnestEvents, xnestPointerDevice, MotionNotify, QueuePointerEvents(xnestPointerDevice, MotionNotify,
0, POINTER_ABSOLUTE, &mask); 0, POINTER_ABSOLUTE, &mask);
xnestDirectInstallColormaps(pScreen); xnestDirectInstallColormaps(pScreen);
} }

View File

@ -45,8 +45,6 @@ is" without express or implied warranty.
Bool xnestDoFullGeneration = True; Bool xnestDoFullGeneration = True;
InternalEvent *xnestEvents = NULL;
void void
InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) InitOutput(ScreenInfo *screenInfo, int argc, char *argv[])
{ {
@ -100,8 +98,6 @@ InitInput(int argc, char *argv[])
if (rc != Success) if (rc != Success)
FatalError("Failed to init Xnest default devices.\n"); FatalError("Failed to init Xnest default devices.\n");
GetEventList(&xnestEvents);
mieqInit(); mieqInit();
AddEnabledDevice(XConnectionNumber(xnestDisplay)); AddEnabledDevice(XConnectionNumber(xnestDisplay));

View File

@ -485,8 +485,7 @@ void DarwinSendPointerEvents(DeviceIntPtr pDev, int ev_type, int ev_button, floa
darwinEvents_lock(); { darwinEvents_lock(); {
ValuatorMask mask; ValuatorMask mask;
valuator_mask_set_range(&mask, 0, (pDev == darwinPointer) ? 2 : 5, valuators); valuator_mask_set_range(&mask, 0, (pDev == darwinPointer) ? 2 : 5, valuators);
QueuePointerEvents(darwinEvents, pDev, ev_type, ev_button, QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, &mask);
POINTER_ABSOLUTE, &mask);
DarwinPokeEQ(); DarwinPokeEQ();
} darwinEvents_unlock(); } darwinEvents_unlock();
} }
@ -499,7 +498,7 @@ void DarwinSendKeyboardEvents(int ev_type, int keycode) {
} }
darwinEvents_lock(); { darwinEvents_lock(); {
QueueKeyboardEvents(darwinEvents, darwinKeyboard, ev_type, keycode + MIN_KEYCODE, NULL); QueueKeyboardEvents(darwinKeyboard, ev_type, keycode + MIN_KEYCODE, NULL);
DarwinPokeEQ(); DarwinPokeEQ();
} darwinEvents_unlock(); } darwinEvents_unlock();
} }
@ -526,7 +525,7 @@ void DarwinSendProximityEvents(DeviceIntPtr pDev, int ev_type, float pointer_x,
darwinEvents_lock(); { darwinEvents_lock(); {
ValuatorMask mask; ValuatorMask mask;
valuator_mask_set_range(&mask, 0, 5, valuators); valuator_mask_set_range(&mask, 0, 5, valuators);
QueueProximityEvents(darwinEvents, pDev, ev_type, &mask); QueueProximityEvents(pDev, ev_type, &mask);
DarwinPokeEQ(); DarwinPokeEQ();
} darwinEvents_unlock(); } darwinEvents_unlock();
} }

View File

@ -483,8 +483,7 @@ winSendKeyEvent (DWORD dwKey, Bool fDown)
/* Update the keyState map */ /* Update the keyState map */
g_winKeyState[dwKey] = fDown; g_winKeyState[dwKey] = fDown;
GetEventList(&events); QueueKeyboardEvents(g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL);
QueueKeyboardEvents(events, g_pwinKeyboard, fDown ? KeyPress : KeyRelease, dwKey + MIN_KEYCODE, NULL);
winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n", winDebug("winSendKeyEvent: dwKey: %d, fDown: %d, nEvents %d\n",
dwKey, fDown, nevents); dwKey, fDown, nevents);

View File

@ -234,15 +234,13 @@ winMouseWheel (ScreenPtr pScreen, int iDeltaZ)
void void
winMouseButtonsSendEvent (int iEventType, int iButton) winMouseButtonsSendEvent (int iEventType, int iButton)
{ {
InternalEvent* events;
ValuatorMask mask; ValuatorMask mask;
if (g_winMouseButtonMap) if (g_winMouseButtonMap)
iButton = g_winMouseButtonMap[iButton]; iButton = g_winMouseButtonMap[iButton];
valuator_mask_zero(&mask); valuator_mask_zero(&mask);
GetEventList(&events); QueuePointerEvents(g_pwinPointer, iEventType, iButton,
QueuePointerEvents(events, g_pwinPointer, iEventType, iButton,
POINTER_RELATIVE, &mask); POINTER_RELATIVE, &mask);
#if CYGDEBUG #if CYGDEBUG
@ -365,15 +363,13 @@ void winEnqueueMotion(int x, int y)
{ {
int valuators[2]; int valuators[2];
ValuatorMask mask; ValuatorMask mask;
InternalEvent* events;
miPointerSetPosition(g_pwinPointer, POINTER_RELATIVE, &x, &y); miPointerSetPosition(g_pwinPointer, POINTER_RELATIVE, &x, &y);
valuators[0] = x; valuators[0] = x;
valuators[1] = y; valuators[1] = y;
valuator_mask_set_range(&mask, 0, 2, valuators); valuator_mask_set_range(&mask, 0, 2, valuators);
GetEventList(&events); QueuePointerEvents(g_pwinPointer, MotionNotify, 0,
QueuePointerEvents(events, g_pwinPointer, MotionNotify, 0,
POINTER_ABSOLUTE | POINTER_SCREEN, &mask); POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
} }

View File

@ -111,7 +111,6 @@ typedef struct _ValuatorMask ValuatorMask;
/* The DIX stores incoming input events in this list */ /* The DIX stores incoming input events in this list */
extern InternalEvent* InputEventList; extern InternalEvent* InputEventList;
extern int InputEventListLen;
typedef int (*DeviceProc)( typedef int (*DeviceProc)(
DeviceIntPtr /*device*/, DeviceIntPtr /*device*/,
@ -429,7 +428,6 @@ extern _X_EXPORT void CloseInput(void);
extern _X_EXPORT int GetMaximumEventsNum(void); extern _X_EXPORT int GetMaximumEventsNum(void);
extern _X_EXPORT int GetEventList(InternalEvent** list);
extern _X_EXPORT InternalEvent *InitEventList(int num_events); extern _X_EXPORT InternalEvent *InitEventList(int num_events);
extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events); extern _X_EXPORT void FreeEventList(InternalEvent *list, int num_events);
@ -452,7 +450,6 @@ extern _X_EXPORT int GetPointerEvents(
const ValuatorMask *mask); const ValuatorMask *mask);
extern _X_EXPORT void QueuePointerEvents( extern _X_EXPORT void QueuePointerEvents(
InternalEvent *events,
DeviceIntPtr pDev, DeviceIntPtr pDev,
int type, int type,
int buttons, int buttons,
@ -467,7 +464,6 @@ extern _X_EXPORT int GetKeyboardEvents(
const ValuatorMask *mask); const ValuatorMask *mask);
extern _X_EXPORT void QueueKeyboardEvents( extern _X_EXPORT void QueueKeyboardEvents(
InternalEvent *events,
DeviceIntPtr pDev, DeviceIntPtr pDev,
int type, int type,
int key_code, int key_code,
@ -480,7 +476,6 @@ extern int GetProximityEvents(
const ValuatorMask *mask); const ValuatorMask *mask);
extern void QueueProximityEvents( extern void QueueProximityEvents(
InternalEvent *events,
DeviceIntPtr pDev, DeviceIntPtr pDev,
int type, int type,
const ValuatorMask *mask); const ValuatorMask *mask);