sway
sway copied to clipboard
Mouse input coordinates messed up in Iron Harvest with multiple outputs
Steam with Proton 5.13.
- Open Steam on the output on the right
- Start Iron Harvest
- A full screen window shows up. Clicks correctly skip the intro, however the click coordinates are wrong and it's not possible to use the game menu at all.
- Move workspace to the left output, clicks now work again
- Move to the right output again, still works
It seems the game fullscreens itself before mapping on the left output. However X11 doesn't have a "fullscreen output" hint, the window position is used instead to tell the WM which output to pick. We ignore the position right now.
The window sends a bunch of configure requests at position 0,0, and we send back some configure notify events at 1680,0.
00:00:37.164 [DEBUG] [xwayland/xwm.c:926] XCB_CONFIGURE_REQUEST (37748737) [1680x1050+0,0]
00:00:37.164 [sway/desktop/xwayland.c:244] configure 1680.000000 0.000000 2194x1234
We could extract the output from the position when the window is mapped, however I'm not sure all X11 clients set the position properly when mapping (we don't want to open all X11 fullscreen windows on the left output when the user has the right output focused). Ultimately I think the game is just buggy and should handle configure events even if they don't match its expectations.
There's also _NET_WM_FULLSCREEN_MONITORS that we ignore, but seems unused by winex11.
Additionally, clients specify a mask in their configure requests, maybe we could check if the x/y bits are set there to know if the client requested a particular position.
This seems to be affecting other games as well. Clicks on some of my games only work on the left monitor or left side of my right widescreen monitor. Tested on Grim Dawn and The Outer Worlds
I'm experiencing this bug with Realm Of The Mad God. This one is free to play, which might make it a good one to test with. It's also built with the Unity Game Engine, which makes me suspect all Unity games may trigger this bug.
Had this issue with Phasmophobia (a Unity game). Fixed it by unplugging my left monitor and plugging it back in. If this doesn't work for anyone else, this may be a different issue to this one
I saw a similar issue with Starcraft 2 as well, the cursor has an offset between the clicked/hovered position and where the cursor is rendered.
Seems related to #8590