From 6234e7445b440cbd53c2b4aee78966949af098d5 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 8 Aug 2010 02:04:47 +0000 Subject: [PATCH] - Added m_hidepointer cvar to control whether or not the mouse pointer is hidden when it's grabbed. At least if the pointer is visible when the debugger break happens, I don't worry about it getting stuck hidden. (Note that that seems to be related to Alt+Tabbing out of the game and coming back. I wish I knew what's going on.) SVN r2497 (trunk) --- src/win32/i_mouse.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/win32/i_mouse.cpp b/src/win32/i_mouse.cpp index fc55c0456..af595dea5 100644 --- a/src/win32/i_mouse.cpp +++ b/src/win32/i_mouse.cpp @@ -136,9 +136,10 @@ FMouse *Mouse; bool CursorState; -CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) -CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) -CVAR (Bool, m_filter, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CVAR (Bool, m_filter, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) +CVAR (Bool, m_hidepointer, true, 0) CUSTOM_CVAR (Int, in_mouse, 0, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITCALL) { @@ -181,10 +182,10 @@ CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE) static void SetCursorState(bool visible) { - CursorState = visible; + CursorState = visible || !m_hidepointer; if (GetForegroundWindow() == Window) { - if (visible) + if (CursorState) { SetCursor((HCURSOR)(intptr_t)GetClassLongPtr(Window, GCLP_HCURSOR)); }