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

SDL: Use SDL_SetWindowMouseRect to confine the mouse area #3546

merged 1 commit into from Nov 19, 2021


Copy link

@ccawley2011 ccawley2011 commented Nov 16, 2021

The latest version of SDL2 from git adds a new function to confine the mouse to the specified area of the screen. Currently, ScummVM confines the mouse position by warping the mouse manually when it's grabbed and a stretch mode that leaves empty space is enabled, but that doesn't work with Wayland. While I did initially encounter issues with this in the Fedora 35 + Plasma 3.22.5 VM that I set up for Wayland testing, it seems to have been resolved somehow.

See also: libsdl-org/SDL#4822

Copy link

@eriktorbjorn eriktorbjorn commented Nov 17, 2021

SDL_SetWindowMouseRect() sounds like it may be useful for other things as well, because I seem to recall that there are games (I just can't recall which at the moment, or even if they were games that ScummVM supports) where the original restricts the mouse to a smaller area than the full window in some cases.


Copy link

@sev- sev- commented Nov 19, 2021

Excellent, thank you!


@sev- sev- merged commit c6836c9 into scummvm:master Nov 19, 2021
8 checks passed
@ccawley2011 ccawley2011 deleted the sdl-mouse-rect branch Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
3 participants