fix(videoout): preserve relative mouse mode for ToggleMouse #6195

Closed
hossiendehghan989 wants to merge 1 commit from upstream-pr/6195 into main
hossiendehghan989 commented 2026-10-15 01:46:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hossiendehghan989 on 2026-10-15T01:46:14Z.


What

Fixes #6147 by keeping SDL relative mouse mode owned by ToggleMouse instead of releasing it on every presentation-loop iteration.

Why

VideoOutDriver calls MouseInput::UpdateCapture(!padInput.MouseModeEnabled()) every frame. When ToggleMouse is enabled, allowed is false; the previous implementation interpreted that as a request to disable SDL relative mode. That made the cursor visible and limited camera movement to the window or screen edges.

When capture is not allowed, MouseInput now clears its guest-mouse capture bookkeeping but leaves SDL relative mode untouched. PadInput::setMouseMode(false) remains the owner of disabling relative mode when the toggle is turned off. The normal guest-mouse capture path is unchanged.

Tested

python3 tools/check_conventions.py --base upstream/main
git diff --check
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON
cmake --build build --target video_out_mouse_tests --parallel 2
ctest --test-dir build -R '^video_out_mouse$' --output-on-failure
Result: 1/1 test passed.

Checklist

Based on current main; no other open PR implements the same functions
One topic per PR; follow-ups go in a new PR
No comments in code except technical debt
No third-party code added
Generic behavior, not title-specific
Depends on: none
Unblocks: none
GPUs tested: n/a
AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4866983396 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6195). Originally posted by [hossiendehghan989](https://github.com/hossiendehghan989) on 2026-10-15T01:46:14Z. --- ### What Fixes #6147 by keeping SDL relative mouse mode owned by ToggleMouse instead of releasing it on every presentation-loop iteration. ### Why VideoOutDriver calls MouseInput::UpdateCapture(!padInput.MouseModeEnabled()) every frame. When ToggleMouse is enabled, allowed is false; the previous implementation interpreted that as a request to disable SDL relative mode. That made the cursor visible and limited camera movement to the window or screen edges. When capture is not allowed, MouseInput now clears its guest-mouse capture bookkeeping but leaves SDL relative mode untouched. PadInput::setMouseMode(false) remains the owner of disabling relative mode when the toggle is turned off. The normal guest-mouse capture path is unchanged. ### Tested python3 tools/check_conventions.py --base upstream/main git diff --check cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON cmake --build build --target video_out_mouse_tests --parallel 2 ctest --test-dir build -R '^video_out_mouse$' --output-on-failure Result: 1/1 test passed. ### Checklist Based on current main; no other open PR implements the same functions One topic per PR; follow-ups go in a new PR No comments in code except technical debt No third-party code added Generic behavior, not title-specific Depends on: none Unblocks: none GPUs tested: n/a AI-assisted: yes
github-actions[bot] commented 2026-10-15 01:52:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T01:52:05Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6153 core/libs/prx/libSceVideoOut/tests/MouseInput.cpp L70
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182563935 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6195#issuecomment-6182563935). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T01:52:05Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6153](https://www.github.com/boykopovar/AnyPS5/pull/6153) | `core/libs/prx/libSceVideoOut/tests/MouseInput.cpp` [L70](https://github.com/boykopovar/AnyPS5/blob/93e54cedd3dd49eabf1c589f020b54758e0b6461/core/libs/prx/libSceVideoOut/tests/MouseInput.cpp#L70) | | |
hossiendehghan989 commented 2026-10-15 02:11:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hossiendehghan989 on 2026-10-15T02:11:20Z.


This PR overlaps with #6153 in both the implementation and regression test. The current branch has passing checks, but I’m happy to rebase, consolidate, or defer to whichever implementation the maintainers prefer.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6182813127 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6195#issuecomment-6182813127). Originally posted by [hossiendehghan989](https://github.com/hossiendehghan989) on 2026-10-15T02:11:20Z. --- This PR overlaps with #6153 in both the implementation and regression test. The current branch has passing checks, but I’m happy to rebase, consolidate, or defer to whichever implementation the maintainers prefer.
MarcZX10 commented 2026-10-16 04:25:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T04:25:06Z.


I confirmed the current checks: the latest conventions run passes (an earlier run failed), and the other hosted checks pass; the platform build jobs are skipped. This PR and #6153 implement the same relative-mouse-mode handoff and update the same regression test. Please coordinate with #6153’s author on which PR should proceed or whether to consolidate; I am not recommending which one to close.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208050012 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6195#issuecomment-6208050012). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T04:25:06Z. --- I confirmed the current checks: the latest conventions run passes (an earlier run failed), and the other hosted checks pass; the platform build jobs are skipped. This PR and #6153 implement the same relative-mouse-mode handoff and update the same regression test. Please coordinate with #6153’s author on which PR should proceed or whether to consolidate; I am not recommending which one to close.
oneandonlydean commented 2026-10-17 00:10:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T00:10:24Z.


Closing in favour of #6153, which makes the same UpdateCapture change and whose test also checks that the guest capture comes back after mouse-to-stick mode, with a Linux run failing on main and passing with it. Thanks for offering to defer.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6227128876 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6195#issuecomment-6227128876). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T00:10:24Z. --- Closing in favour of #6153, which makes the same `UpdateCapture` change and whose test also checks that the guest capture comes back after mouse-to-stick mode, with a Linux run failing on main and passing with it. Thanks for offering to defer.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!6195
No description provided.