From 932a5ba8f7421bbb9ba4a0d6b7fb5139064f105c Mon Sep 17 00:00:00 2001 From: Samuel Nicol <99494967+Github-Samuel@users.noreply.github.com> Date: Wed, 29 Jul 2026 14:53:25 +0200 Subject: [PATCH] fix(rage-input-five): release the cursor clip when the window loses focus `ClipHostCursor` keeps the last rect it applied and skips the call when it is asked for the same one again, to avoid the repeated `ClipCursor` calls that load DWM. Windows drops the clip by itself when the window stops being the foreground one, but that cache does not know about it, so when the game asks for the same rect again after alt tabbing back the call is treated as a duplicate and never reaches `ClipCursor`. The cursor is then free to leave the window during gameplay. Clear the cache on `WM_ACTIVATEAPP` when focus is lost so the game's own request goes through on the way back in. `rage-input-rdr3` already does this, from pr-3637. Signed-off-by: Samuel Nicol <99494967+Github-Samuel@users.noreply.github.com> --- code/components/rage-input-five/src/InputHook.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/components/rage-input-five/src/InputHook.cpp b/code/components/rage-input-five/src/InputHook.cpp index ede7cd6df3..0e66489447 100644 --- a/code/components/rage-input-five/src/InputHook.cpp +++ b/code/components/rage-input-five/src/InputHook.cpp @@ -266,6 +266,10 @@ LRESULT APIENTRY grcWindowProcedure(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM if (uMsg == WM_ACTIVATEAPP) { g_isFocused = (wParam) ? true : false; + if (!g_isFocused) + { + ClipHostCursor(NULL); + } } if (uMsg >= WM_KEYFIRST && uMsg <= WM_KEYLAST)