gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

Problem with mouse position/offset

Open DoomSlinger opened this issue 1 year ago • 4 comments

The latest version of gamescope has an issue where the "select" position of the mouse is not properly mapped to it's position. For example, if my mouse is at the bottom right of the screen, then buttons in a UI will be highlighted up and to the left.

It's sort of like the area of the screen that the mouse is mapped to is not lined up with the area that the mouse can move to.

Happens regardless of if it's in full screen or not, and the window size doesn't matter either.

OS: Arch Linux x86_64 Kernel: 6.8.2-arch2-1 Shell: bash 5.2.26 DE: Plasma 6.0.3 WM: kwin CPU: AMD Ryzen 7 5800X (16) @ 3.800GHz GPU: AMD ATI Radeon RX 7900 GRE Memory: 8074MiB / 32018MiB

DoomSlinger avatar Apr 14 '24 10:04 DoomSlinger

Is this in wayland?

ninjaquick avatar Apr 24 '24 16:04 ninjaquick

I'm also having this issue on Plasma 6.0.4.1 (wayland) and gamescope 3.14.12, so it seems like it might be a plasma issue. --force-grab-cursor is a workaround. This is a multi monitor setup and the game monitor has scaling enabled.

sad-goldfish avatar May 04 '24 09:05 sad-goldfish

I'm also having this issue on Gamescope 3.14.15 and Plasma Kwin 6.0.90.1. This issue also applies to Xournalpp with GDK_BACKEND=X11 (so this rules out Wine issues). The misalignment only happens when scaling is enabled. Also, when I start gamescope with gamescope -W 3840 -H 2160 -- env GDK_BACKEND=x11 xournalpp and scaling enabled, the gamescope window is much bigger than the bounds of the 4k monitor (it overflows onto the other monitor), which again seems like a scaling issue. Conversely, doing the same while scaling is disabled makes the window fit roughly on the 4k monitor.

So I guess something is going wrong with the scaling communications between Gamescope and Plasma. Any ideas on where to debug?

Using a wrapper script which changes scale is a workaround too:

#!/bin/sh
kscreen-doctor output.1.scale.1
gamescope "$@"
kscreen-doctor output.1.scale.1.5

EDIT: I guess this is a duplicate of #1208

sad-goldfish avatar May 29 '24 17:05 sad-goldfish

This bug no longer seems to happen after 09cb7b451d8825e597d15ab9d30e43aee8418670. The windows is still much bigger than the bounds of the 4k monitor but that is easily worked around by just fullscreening.

EDIT: The window size issue appears to be specific to Xournalpp and does not appear to happen for Wine/Proton clients

sad-goldfish avatar Jun 04 '24 23:06 sad-goldfish