Skip to content

Commit 97effb9

Browse files
RicardoLuis0coelckers
authored andcommitted
fix mouse cursor randomly becoming invisible outside gzdoom
1 parent 6777423 commit 97effb9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/common/platform/win32/i_input.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ EXTERN_CVAR (Bool, use_mouse)
110110
static int WheelDelta;
111111
extern bool CursorState;
112112

113+
void SetCursorState(bool visible);
114+
113115
extern BOOL paused;
114116
static bool noidle = false;
115117

@@ -415,7 +417,7 @@ LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
415417
case WM_SETCURSOR:
416418
if (!CursorState)
417419
{
418-
SetCursor(NULL); // turn off window cursor
420+
SetCursorState(false); // turn off window cursor
419421
return TRUE; // Prevent Windows from setting cursor to window class cursor
420422
}
421423
else

src/common/platform/win32/i_mouse.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ enum EMouseMode
131131

132132
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
133133

134-
static void SetCursorState(bool visible);
134+
void SetCursorState(bool visible);
135135
static FMouse *CreateWin32Mouse();
136136
static FMouse *CreateDInputMouse();
137137
static FMouse *CreateRawMouse();
@@ -191,7 +191,7 @@ CUSTOM_CVAR (Int, in_mouse, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL)
191191

192192
static bool mouse_shown = true;
193193

194-
static void SetCursorState(bool visible)
194+
void SetCursorState(bool visible)
195195
{
196196
CursorState = visible || !m_hidepointer;
197197
if (GetForegroundWindow() == mainwindow.GetHandle())

0 commit comments

Comments
 (0)