gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

Mouse capture stopped working (and launchers exit gamescope)

Open OlaHulleberg opened this issue 11 months ago • 2 comments

This issue started from commit 6394fbc, and works with the commits prior.

To those of you reading, temporary fix is to rebase onto this commit, and rebuild: 2898cce

Game: War Thunder Command: gamescope -f -W 2560 -H 1440 -w 2560 -h 1440 --adaptive-sync --force-grab-cursor -- /**/launcher Description: The cursor is really jumpy in the launcher (lagging), and whenever I click "Play", the entire Gamescope session crashes.

If I directly launch aces (the game process), it reveals that the cursor is not being properly captured. It goes all the way towards the edge and kind of spasms back and forth when I try dragging it further.

Using ENV variable: WLR_NO_HARDWARE_CURSORS=1

Neofetch: OS: Manjaro Linux x86_64 Host: X570 AORUS MASTER -CF Kernel: 6.6.19-1-MANJARO Packages: 1511 (pacman), 11 (flatpak), 10 (snap) Shell: zsh 5.9 Resolution: 5120x1440 DE: Hyprland (Wayland) CPU: AMD Ryzen 7 3800X (16) @ 3.900GHz GPU: NVIDIA GeForce RTX 3080 12GB Memory: 32036MiB

EDIT: Seems like the cursor and launcher crashing are two separate issues. Rollbacking to 2898cce seems to fix cursor, but not the launchers crashing. I will come back with a commit that works for the crash issue.

EDIT2: Seems like this gets deeper and deeper. Rollbacking to 97c358e solves the crashing issue, but presents another issue where the game seems to be slowed down (this is entirely speculation as to why) by too many input requests. However, leaving the game running for 3+ minutes resolves this issue. This could very well just be an issue on my end, and needs further testing to confirm the consistency and reason why.

EDIT3: After repeated testing, it seems that the issue found in EDIT2 is yet to be reproduced. So it can safely be ignored for now. However, the mouse capturing issue still remains.

In the meantime, this is a safe commit for all of this: 66df442

OlaHulleberg avatar Mar 15 '24 17:03 OlaHulleberg

I can confirm to have the same mouse issues after upgrading form 3.14.0 to 3.14.2 on arch. I downgraded and all works fine.

bullet92 avatar Mar 21 '24 11:03 bullet92

Things like electron apps or other such apps which will completely stop updating when nothing is going on will 'break' the cursor, or make it 'laggy' or 'janky'.

Here's a quick way to test it with common electron app:

gamescope -w 5120 -h 1440 -W 5120 -H 1440 -f --force-grab-cursor -- discord

  1. Find a video
  2. Click play
  3. Move the cursor
    • Note how it is relatively smooth (whatever the content is animating at)
  4. Pause video
  5. Move the cursor again
    • The cursor is now jumpy/intermittent

As for the pointer behavior once in game, it isn't ideal but its a great start. The pointer doesn't warp to some distant place when it's requested, which is great. However, when it is requested by the app it appears wherever it was according to the compositor - so it could be along the edge of the window or anywhere else. Games that move the camera based on pointer motion get weird with this, or in the case of Star Citizen, can make it incredibly difficult to interact with things in game. In games like World of Warships, the cursor being somewhere random can result in losing the white triangle somewhere on a white screen, which can be fairly devastating to german battleship players trying to aim secondaries.

~~I can get around the launcher crash by launching with MangoHud enabled.~~ Nevermind. The ability to launch/not launch seems semi-random. I might throw some loggers in to see where its failing.

ninjaquick avatar Mar 22 '24 04:03 ninjaquick