diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-08 23:14:20 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-06-08 23:28:28 +0930 |
commit | c68ca0c7b2c72df0501d26bf7f640029ff2d9568 (patch) | |
tree | d8be735c3d2686b9f4fd212de3344d834051c73b /hw/xnest | |
parent | 34429d16d319ef2709c22a5c22f45d0e82c78b20 (diff) |
xnest: switch to using EventList rather than xEvents.
Diffstat (limited to 'hw/xnest')
-rw-r--r-- | hw/xnest/Events.c | 14 | ||||
-rw-r--r-- | hw/xnest/Init.c | 7 |
2 files changed, 10 insertions, 11 deletions
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c index f7a551c17..355b46f98 100644 --- a/hw/xnest/Events.c +++ b/hw/xnest/Events.c @@ -43,7 +43,7 @@ is" without express or implied warranty. CARD32 lastEventTime = 0; -extern xEvent *xnestEvents; +extern EventList *xnestEvents; void ProcessInputEvents() @@ -106,10 +106,11 @@ xnestQueueKeyEvent(int type, unsigned int keycode) { int i, n; + GetEventList(&xnestEvents); lastEventTime = GetTimeInMillis(); n = GetKeyboardEvents(xnestEvents, xnestKeyboardDevice, type, keycode); for (i = 0; i < n; i++) - mieqEnqueue(xnestKeyboardDevice, xnestEvents + i); + mieqEnqueue(xnestKeyboardDevice, (xnestEvents + i)->event); } void @@ -119,6 +120,7 @@ xnestCollectEvents(void) xEvent x; int i, n, valuators[2]; ScreenPtr pScreen; + GetEventList(&xnestEvents); while (XCheckIfEvent(xnestDisplay, &X, xnestNotExposurePredicate, NULL)) { switch (X.type) { @@ -138,7 +140,7 @@ xnestCollectEvents(void) n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonPress, X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL); for (i = 0; i < n; i++) - mieqEnqueue(xnestPointerDevice, xnestEvents + i); + mieqEnqueue(xnestPointerDevice, (xnestEvents + i)->event); break; case ButtonRelease: @@ -147,7 +149,7 @@ xnestCollectEvents(void) n = GetPointerEvents(xnestEvents, xnestPointerDevice, ButtonRelease, X.xbutton.button, POINTER_RELATIVE, 0, 0, NULL); for (i = 0; i < n; i++) - mieqEnqueue(xnestPointerDevice, xnestEvents + i); + mieqEnqueue(xnestPointerDevice, (xnestEvents + i)->event); break; case MotionNotify: @@ -157,7 +159,7 @@ xnestCollectEvents(void) n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators); for (i = 0; i < n; i++) - mieqEnqueue(xnestPointerDevice, xnestEvents + i); + mieqEnqueue(xnestPointerDevice, (xnestEvents + i)->event); break; case FocusIn: @@ -190,7 +192,7 @@ xnestCollectEvents(void) n = GetPointerEvents(xnestEvents, xnestPointerDevice, MotionNotify, 0, POINTER_ABSOLUTE, 0, 2, valuators); for (i = 0; i < n; i++) - mieqEnqueue(xnestPointerDevice, xnestEvents + i); + mieqEnqueue(xnestPointerDevice, (xnestEvents + i)->event); xnestDirectInstallColormaps(pScreen); } } diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c index de80cb578..f52445c00 100644 --- a/hw/xnest/Init.c +++ b/hw/xnest/Init.c @@ -45,7 +45,7 @@ is" without express or implied warranty. Bool xnestDoFullGeneration = True; -xEvent *xnestEvents = NULL; +EventList *xnestEvents = NULL; void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) @@ -92,10 +92,7 @@ InitInput(int argc, char *argv[]) xnestPointerDevice = AddInputDevice(serverClient, xnestPointerProc, TRUE); xnestKeyboardDevice = AddInputDevice(serverClient, xnestKeyboardProc, TRUE); - if (!xnestEvents) - xnestEvents = (xEvent *) xcalloc(sizeof(xEvent), GetMaximumEventsNum()); - if (!xnestEvents) - FatalError("couldn't allocate room for events\n"); + GetEventList(&xnestEvents); RegisterPointerDevice(xnestPointerDevice); RegisterKeyboardDevice(xnestKeyboardDevice); |