From a2f96d3135d71828bf1dfc8407b456decb444892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Wed, 12 Sep 2007 19:24:07 +0100 Subject: [PATCH] Update for input interface changes. --- hw/xgl/glx/xglx.c | 23 +++++++++++------------ hw/xgl/xglinput.c | 7 +++---- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/hw/xgl/glx/xglx.c b/hw/xgl/glx/xglx.c index 92974f0d4..1cf20980b 100644 --- a/hw/xgl/glx/xglx.c +++ b/hw/xgl/glx/xglx.c @@ -50,7 +50,7 @@ #ifdef XKB #include -#include +#include #include extern Bool @@ -975,6 +975,8 @@ xglxBlockHandler (pointer blockData, XFlush (xdisplay); } +static DeviceIntPtr pKeyboard, pPointer; + static void xglxWakeupHandler (pointer blockData, int result, @@ -991,25 +993,25 @@ xglxWakeupHandler (pointer blockData, x.u.u.type = KeyPress; x.u.u.detail = X.xkey.keycode; x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis (); - mieqEnqueue (&x); + mieqEnqueue (pKeyboard, &x); break; case KeyRelease: x.u.u.type = KeyRelease; x.u.u.detail = X.xkey.keycode; x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis (); - mieqEnqueue (&x); + mieqEnqueue (pKeyboard, &x); break; case ButtonPress: x.u.u.type = ButtonPress; x.u.u.detail = X.xbutton.button; x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis (); - mieqEnqueue (&x); + mieqEnqueue (pPointer, &x); break; case ButtonRelease: x.u.u.type = ButtonRelease; x.u.u.detail = X.xbutton.button; x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis (); - mieqEnqueue (&x); + mieqEnqueue (pPointer, &x); break; case MotionNotify: x.u.u.type = MotionNotify; @@ -1018,7 +1020,7 @@ xglxWakeupHandler (pointer blockData, x.u.keyButtonPointer.rootY = X.xmotion.y; x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis (); miPointerAbsoluteCursor (X.xmotion.x, X.xmotion.y, lastEventTime); - mieqEnqueue (&x); + mieqEnqueue (pPointer, &x); break; case EnterNotify: if (X.xcrossing.detail != NotifyInferior) { @@ -1030,7 +1032,7 @@ xglxWakeupHandler (pointer blockData, x.u.keyButtonPointer.rootY = X.xcrossing.y; x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis (); - mieqEnqueue (&x); + mieqEnqueue (pPointer, &x); } } break; @@ -1046,7 +1048,7 @@ xglxBell (int volume, pointer ctrl, int cls) { - XBell (xdisplay, volume); + XBell (xdisplay, volume); } static void @@ -1259,16 +1261,13 @@ void xglxInitInput (int argc, char **argv) { - DeviceIntPtr pKeyboard, pPointer; - pPointer = AddInputDevice (xglMouseProc, TRUE); pKeyboard = AddInputDevice (xglxKeybdProc, TRUE); RegisterPointerDevice (pPointer); RegisterKeyboardDevice (pKeyboard); - miRegisterPointerDevice (screenInfo.screens[0], pPointer); - mieqInit (&pKeyboard->public, &pPointer->public); + mieqInit (); AddEnabledDevice (XConnectionNumber (xdisplay)); diff --git a/hw/xgl/xglinput.c b/hw/xgl/xglinput.c index cda21ad49..f745f8b4d 100644 --- a/hw/xgl/xglinput.c +++ b/hw/xgl/xglinput.c @@ -51,9 +51,9 @@ xglMouseProc (DeviceIntPtr pDevice, InitPointerDeviceStruct (pDev, map, NUM_BUTTONS, - miPointerGetMotionEvents, + GetMotionHistory, (PtrCtrlProcPtr) NoopDDA, - miPointerGetMotionBufferSize ()); + GetMotionHistorySize (), 2); break; case DEVICE_ON: pDev->on = TRUE; @@ -258,6 +258,5 @@ xglInitInput (int argc, char **argv) RegisterPointerDevice (pPointer); RegisterKeyboardDevice (pKeyboard); - miRegisterPointerDevice (screenInfo.screens[0], pPointer); - mieqInit (&pKeyboard->public, &pPointer->public); + mieqInit (); }