mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-08-20 09:57:09 +00:00
Fix mouse cursor staying trapped in window on alt-tab
When the inventory or other UI with a hidden cursor was open, alt-tabbing out would leave the cursor locked to the game window. SetWindowFocused(false) from WM_KILLFOCUS correctly released the clip and showed the cursor, but Tick() was unconditionally calling SetCursorPos every frame to re-center it, overriding the release. Added m_windowFocused to the Tick() condition so cursor manipulation only happens while the window actually has focus.
This commit is contained in:
parent
0989458b17
commit
ddc9b6ca21
|
|
@ -125,7 +125,7 @@ void KeyboardMouseInput::Tick()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((m_mouseGrabbed || m_cursorHiddenForUI) && g_hWnd)
|
if ((m_mouseGrabbed || m_cursorHiddenForUI) && m_windowFocused && g_hWnd)
|
||||||
{
|
{
|
||||||
RECT rc;
|
RECT rc;
|
||||||
GetClientRect(g_hWnd, &rc);
|
GetClientRect(g_hWnd, &rc);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue