From a07b9bb8e9fcd5b563039dafaa3aa5d0712711d2 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: Jon TURNEY Date: Sun, 2 Nov 2008 18:27:11 +0000 Subject: [PATCH 03/32] Cygwin: update for MPX device changes Signed-off-by: Jon TURNEY --- hw/xwin/InitInput.c | 16 +++++++++------- hw/xwin/win.h | 2 ++ hw/xwin/winmultiwindowwndproc.c | 4 ++-- hw/xwin/winwndproc.c | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c index fd4f26f..d7e3f9c 100644 --- a/hw/xwin/InitInput.c +++ b/hw/xwin/InitInput.c @@ -49,6 +49,8 @@ DISPATCH_PROC(winProcSetSelectionOwner); */ CARD32 g_c32LastInputEventTime = 0; +DeviceIntPtr g_pwinPointer; +DeviceIntPtr g_pwinKeyboard; /* @@ -94,7 +96,6 @@ ProcessInputEvents (void) #endif mieqProcessInputEvents (); - miPointerUpdate (); #if 0 ErrorF ("ProcessInputEvents - returning\n"); @@ -122,8 +123,6 @@ TimeSinceLastInputEvent () void InitInput (int argc, char *argv[]) { - DeviceIntPtr pMouse, pKeyboard; - #if CYGDEBUG winDebug ("InitInput\n"); #endif @@ -145,11 +144,14 @@ InitInput (int argc, char *argv[]) } #endif - pMouse = AddInputDevice (winMouseProc, TRUE); - pKeyboard = AddInputDevice (winKeybdProc, TRUE); + g_pwinPointer = AddInputDevice (serverClient, winMouseProc, TRUE); + g_pwinKeyboard = AddInputDevice (serverClient, winKeybdProc, TRUE); - RegisterPointerDevice (pMouse); - RegisterKeyboardDevice (pKeyboard); + RegisterPointerDevice (g_pwinPointer); + RegisterKeyboardDevice (g_pwinKeyboard); + + g_pwinPointer->name = strdup("Windows mouse"); + g_pwinKeyboard->name = strdup("Windows keyboard"); miRegisterPointerDevice (screenInfo.screens[0], pMouse); mieqInit ((DevicePtr)pKeyboard, (DevicePtr)pMouse); diff --git a/hw/xwin/win.h b/hw/xwin/win.h index ea54b99..c45b4f5 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -639,6 +639,8 @@ extern HINSTANCE g_hInstance; extern int g_copyROP[]; extern int g_patternROP[]; extern const char * g_pszQueryHost; +extern DeviceIntPtr g_pwinPointer; +extern DeviceIntPtr g_pwinKeyboard; /* diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index 20ff9f7..d7fc122 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -495,8 +495,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message, break; /* Has the mouse pointer crossed screens? */ - if (s_pScreen != miPointerGetScreen(inputInfo.pointer)) - miPointerSetScreen (inputInfo.pointer, s_pScreenInfo->dwScreen, + if (s_pScreen != miPointerGetScreen(g_pwinPointer)) + miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen, ptMouse.x - s_pScreenInfo->dwXOffset, ptMouse.y - s_pScreenInfo->dwYOffset); diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index 29ea81f..66f439f 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -724,8 +724,8 @@ winWindowProc (HWND hwnd, UINT message, break; /* Has the mouse pointer crossed screens? */ - if (s_pScreen != miPointerGetScreen(inputInfo.pointer)) - miPointerSetScreen (inputInfo.pointer, s_pScreenInfo->dwScreen, + if (s_pScreen != miPointerGetScreen(g_pwinPointer)) + miPointerSetScreen (g_pwinPointer, s_pScreenInfo->dwScreen, GET_X_LPARAM(lParam)-s_pScreenInfo->dwXOffset, GET_Y_LPARAM(lParam)-s_pScreenInfo->dwYOffset); -- 1.6.0.2