Skip to content

Commit

Permalink
fixed cursor disappearing after alt tab
Browse files Browse the repository at this point in the history
  • Loading branch information
pierow committed Oct 30, 2021
1 parent 039f01e commit 5a42d00
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main/source/mod/AvHPieMenuHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void AvHPieMenuHandler::InternalClosePieMenu(void)
sLastNodeHighlighted = NULL;

// Return to raw input after menu closes
if (CVAR_GET_FLOAT("m_rawinput") != 0)
if (CVAR_GET_FLOAT("m_rawinput") != 0 && sPieMenuOpen)
{
SDL_SetRelativeMouseMode(SDL_TRUE);
}
Expand Down Expand Up @@ -192,14 +192,15 @@ void AvHPieMenuHandler::OpenPieMenu(void)

// OS cursor displaying over in game cursor fix. Remove if showcursor code in SetMouseVisibility is made bug free.
#ifdef WIN32
if (!sPieMenuOpen)
ShowCursor(FALSE);
#endif
}

gHUD.HideCrosshair();

// Workaround for not being able to center mouse with raw input enabled.
if (CVAR_GET_FLOAT("m_rawinput") != 0)
if (CVAR_GET_FLOAT("m_rawinput") != 0 && !sPieMenuOpen)
{
SDL_SetRelativeMouseMode(SDL_FALSE);
gEngfuncs.pfnSetMousePos(gEngfuncs.GetWindowCenterX(), gEngfuncs.GetWindowCenterY());
Expand Down

0 comments on commit 5a42d00

Please sign in to comment.