@@ -44,8 +44,6 @@ CLocalGUI::CLocalGUI()
4444
4545 m_LastSettingsRevision = -1 ;
4646 m_LocaleChangeCounter = 0 ;
47-
48- m_StoredMousePosition = {-1 , -1 };
4947}
5048
5149CLocalGUI::~CLocalGUI ()
@@ -713,7 +711,8 @@ bool CLocalGUI::InputGoesToGUI()
713711
714712 // Here we're supposed to check if things like menues are up, console is up or the chatbox is expecting input
715713 // If the console is visible OR the chat is expecting input OR the mainmenu is visible
716- return (IsConsoleVisible () || IsMainMenuVisible () || IsChatBoxInputEnabled () || m_bForceCursorVisible || pGUI->GetGUIInputEnabled () || IsWebRequestGUIVisible ());
714+ return (IsConsoleVisible () || IsMainMenuVisible () || IsChatBoxInputEnabled () || m_bForceCursorVisible || pGUI->GetGUIInputEnabled () ||
715+ !CCore::GetSingleton ().IsFocused () || IsWebRequestGUIVisible ());
717716}
718717
719718void CLocalGUI::ForceCursorVisible (bool bVisible)
@@ -727,18 +726,14 @@ void CLocalGUI::UpdateCursor()
727726
728727 static DWORD dwWidth = CDirect3DData::GetSingleton ().GetViewportWidth ();
729728 static DWORD dwHeight = CDirect3DData::GetSingleton ().GetViewportHeight ();
730- static bool bFirstRun = true ;
729+ static bool bFirstRun = true ;
731730
732731 if (bFirstRun)
733732 {
734- if (!CCore::GetSingleton ().ShouldShowSystemCursorDuringLoad ())
735- {
736- m_StoredMousePosition.x = dwWidth / 2 ;
737- m_StoredMousePosition.y = dwHeight / 2 ;
738- }
733+ m_StoredMousePosition.x = dwWidth / 2 ;
734+ m_StoredMousePosition.y = dwHeight / 2 ;
739735 bFirstRun = false ;
740736 }
741-
742737 // Called in each frame to make sure the mouse is only visible when a GUI control that uses the
743738 // mouse requires it.
744739 if (InputGoesToGUI ())
@@ -751,8 +746,7 @@ void CLocalGUI::UpdateCursor()
751746 CCore::GetSingleton ().GetGame ()->GetPad ()->Clear ();*/
752747
753748 // Restore the mouse cursor to its old position
754- if (m_StoredMousePosition.x != -1 && m_StoredMousePosition.y != -1 )
755- SetCursorPos (m_StoredMousePosition.x , m_StoredMousePosition.y );
749+ SetCursorPos (m_StoredMousePosition.x , m_StoredMousePosition.y );
756750
757751 // Enable our mouse cursor
758752 CSetCursorPosHook::GetSingleton ().DisableSetCursorPos ();
0 commit comments