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

Inconsistent mouse warp behaviour between platforms #7855

Closed
GranMinigun opened this issue Jun 21, 2023 · 1 comment
Closed

Inconsistent mouse warp behaviour between platforms #7855

GranMinigun opened this issue Jun 21, 2023 · 1 comment
Assignees
Milestone

Comments

@GranMinigun
Copy link

DOSBox Staging calls SDL_WarpMouseInWindow() when releasing mouse cursor to center it in the window (whether that's a good idea is a separate topic). It was noticed that using DPI-scaled coordinates works as expected on macOS, but on Windows with HiDPI enabled the cursor lands closer to the upper-left corner instead, suggesting that real pixels are used there as coordinates.

Here's an example code. Left click will try to center the cursor based on DPI-scaled coordinates, and right click - on real pixels. This was tested on up-to-date Windows 10 machine (SDL 2.28 RC 1) and macOS 11 (SDL 2.26.5), confirming the above behaviour. Also tested in X11 (no concept of DPI scaling, so the cursor always lands dead-center), native Wayland, and XWayland (both do not allow the cursor to budge), with SDL 2.26.5.

I'm personally not worried about Wayland's behaviour, but it would be nice to at least document the difference between Windows and macOS.

@slouken
Copy link
Collaborator

slouken commented Jun 21, 2023

Thanks, this is fixed!

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