- 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)
This commit is contained in:
Christoph Oelckers 2010-09-16 22:45:12 +00:00
parent 198c714dad
commit 3424548bec
2 changed files with 5 additions and 0 deletions

View file

@ -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);

View file

@ -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