mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2025-01-18 22:51:39 +00:00
- 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:
parent
198c714dad
commit
3424548bec
2 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue