ValveSoftware / gamescope

SteamOS session compositing window manager
Other
3.2k stars 214 forks source link

Mouse position incorrectly offset with fractional scaliing #1208

Closed sonic2kk closed 6 months ago

sonic2kk commented 8 months ago

System Information

Issue

When using Gamescope on a scaled display, such as a 4k@150%, the mouse will appear in the correct position, but hover behaviour and such is broken. When a mouse is directly over an element, the game will not activate a hover event, likely because it "perceives" the mouse to be in the wrong location. You might have to move it to the side a lot more before the application recognises the mouse position properly.

This behaviour does not happen on unscaled displays.

From looking at the commits it seems like a lot of work is going on around the fractional scaling protocol, so perhaps this is already known.

sonic2kk commented 8 months ago

There are some strange exceptions to this behaviour. I'll note my test cases then:

Working:

Not working (reproduces this issue):

Fullscreen and/or resolution setting does not appear to make a difference for the applications where this can be reproduced.

tornadus commented 7 months ago

A workaround for affected games is forcing the old SDL X11 backend, as I described here: https://github.com/ValveSoftware/gamescope/issues/1245#issuecomment-2081737728 Hopefully this gets fixed soon, I imagine the native wayland backend has some advantages over the old SDL one.

dinotheextinct commented 6 months ago

image

When using the mentioned workaround I still get terrible performance with gamescope. See the frametimes.

sonic2kk commented 6 months ago

Fixed with 7f3f82bd62ecc7284cd22b2bd3f933681723942b.

Also, the backend can now be selected as of 11cfc0d5c9785fec058856e68bb53f8cb4bd8f32. You can fall back to SDL with --backend sdl.