- Hide the cursor by overriding WM_SETCURSOR, as seen in the IDirect3DDEvice9::ShowCursor()

example. Do not modify the window class pointer. I still had an instance where I was left with
  an invisible pointer no matter where I moved it, so hopefully this takes care of that. (edit:
  it doesn't.)

SVN r2496 (trunk)
This commit is contained in:
Randy Heit 2010-08-08 01:53:41 +00:00
commit 6000217889
3 changed files with 20 additions and 8 deletions

View file

@ -134,7 +134,7 @@ static FMouse *(*MouseFactory[])() =
FMouse *Mouse;
HCURSOR TheArrowCursor;
bool CursorState;
CVAR (Bool, use_mouse, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR (Bool, m_noprescale, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
@ -181,11 +181,17 @@ CUSTOM_CVAR(Int, mouse_capturemode, 1, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
static void SetCursorState(bool visible)
{
HCURSOR usingCursor = visible ? TheArrowCursor : NULL;
SetClassLongPtr(Window, GCLP_HCURSOR, (LONG_PTR)usingCursor);
CursorState = visible;
if (GetForegroundWindow() == Window)
{
SetCursor(usingCursor);
if (visible)
{
SetCursor((HCURSOR)(intptr_t)GetClassLongPtr(Window, GCLP_HCURSOR));
}
else
{
SetCursor(NULL);
}
}
}