From 3424548bec794220ec2097c72777f553a7ed5896 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 16 Sep 2010 22:45:12 +0000 Subject: [PATCH] - skip all mouse move events that come right after switching to native mouse. Windows sends some when the mouseis ungrabbed even when it does not move. This caused the currently selected menu item to get unselected. SVN r2803 (trunk) --- src/win32/i_input.cpp | 3 +++ src/win32/i_mouse.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/win32/i_input.cpp b/src/win32/i_input.cpp index c5370fb03..678c03b77 100644 --- a/src/win32/i_input.cpp +++ b/src/win32/i_input.cpp @@ -158,6 +158,7 @@ LPDIRECTINPUT g_pdi3; BOOL AppActive = TRUE; int SessionState = 0; +int BlockMouseMove; CVAR (Bool, k_allowfullscreentoggle, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) @@ -319,6 +320,7 @@ bool GUIWndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESU else if (message == WM_MOUSEMOVE) { ev.subtype = EV_GUI_MouseMove; + if (BlockMouseMove > 0) return true; } { @@ -807,6 +809,7 @@ void I_GetEvent () // void I_StartTic () { + BlockMouseMove--; ResetButtonTriggers (); I_CheckGUICapture (); I_CheckNativeMouse (false); diff --git a/src/win32/i_mouse.cpp b/src/win32/i_mouse.cpp index 0fa46c1db..873b9271a 100644 --- a/src/win32/i_mouse.cpp +++ b/src/win32/i_mouse.cpp @@ -114,6 +114,7 @@ extern HWND Window; extern LPDIRECTINPUT8 g_pdi; extern LPDIRECTINPUT g_pdi3; extern bool GUICapture; +extern int BlockMouseMove; // PRIVATE DATA DEFINITIONS ------------------------------------------------ @@ -283,6 +284,7 @@ void I_CheckNativeMouse(bool preferNative) NativeMouse = want_native; if (want_native) { + BlockMouseMove = 3; Mouse->Ungrab(); } else