Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse grab off leaves mouse confined to single monitor (Windows) #16487

Open
bbbradsmith opened this issue May 1, 2024 · 3 comments
Open

Mouse grab off leaves mouse confined to single monitor (Windows) #16487

bbbradsmith opened this issue May 1, 2024 · 3 comments

Comments

@bbbradsmith
Copy link
Contributor

bbbradsmith commented May 1, 2024

Description

When mouse grab is released, the mouse cursor re-appears, but if you have multiple screens it will not be able to leave the current screen until you can focus a window besides RetroArch.

This is likely specific to the Windows mouse ungrab implementation.

Expected behavior

When mouse grab is released, the released mouse cursor should be able to move to another screen.

Actual behavior

When mouse grab is released, the mouse cursor is confined to the current screen while RetroArch remains focused.

Steps to reproduce the bug

  1. Start portable Retroarch, default settings, should be windowed.
  2. Launch any game.
  3. Press F11 to grab the mouse.
  4. Press F11 to ungrab the mouse.
  5. Observe that the mouse cursor is now trapped inside the current monitor screen.

Bisect Results

Has been present since at least 1.16.0. but probably goes much further back. (I would guess 1.9.1 based on the blame of the relevant code.)

Version/Commit

  • RetroArch: 1.17.0 (64-bit Windows)

Environment information

  • OS: Windows 10
  • Drivers: (should be default)
    • Menu: ozone
    • Video: d3d11
    • Input: dinput
@bbbradsmith
Copy link
Contributor Author

I strongly suspect the problem is here:

GetWindowRect(GetDesktopWindow(), &clip_rect);

If turning mouse grab off, ClipCursor should use a NULL parameter. Instead of releasing the mouse, we've used GetDesktopWindow() to create a confinement to the current screen.

@bbbradsmith
Copy link
Contributor Author

Created a PR to fix this: #16488

@hizzlekizzle
Copy link
Contributor

Identifying a problem, debugging it and then submitting a PR to fix it. You get a gold star for good citizenship. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants