Mouse wrap/capture when playing games under Wayland

Honestly, this is very basic functionality that’s been present under Windows for as long as I can remember.

When playing games under Wayland running multiple monitors, the possibility exists under certain games that for some reason the mouse goes off the screen regarding the display running the game, and into the opposite screen, resulting in your character in game just looking at the sky or the floor - Making gameplay under Wayland basically impossible unless you resort to hacks using Gamescope, which often introduces an entirely new sub set of problems as bad as the mouse going off the screen.

I’ve had this happen under a number of games, but the main game I use to test for the issue is Splitgate (not Splitgate 2). I’ve also encountered the issue playing the demo of Stellar Blade, although it’s less frequent.

This isn’t an issue whatsoever running multiple monitors under X11.

Is there any plan to tackle this problem? Because IMO it’s more important than HDR or VRR, and I honestly cannot understand how it’s still a problem when it’s a basic requirement of essentially any operating system. I want to use Wayland, I really do - But it’s the lack of basic functionality such as this that makes the session essentially unusable.

1 Like

I’ve had similar issues, notably in helldivers 2, when panning the mouse quickly to aim at an enemy - the game “loses” the mouse, and the mouse “pops out” on the monitor to the right.

I don’t have this issue on plasma when using x11, so I’m not sure if this is something in the bowels of wayland, or something in kde-land.

I do believe it is a problem under Gnome. But considering Wayland is nothing more than a protocol, with the compositor doing most of the work, who knows? It seems that applications aren’t really in control of their own windows.

Whatever the case may be, it’s a fairly important part of any operating system and something that should have been implemented right from the onset. The fact it’s still a problem boggles my brain when devs talk about fully depreciating X11.

Pointer warp protocol has recently been merged in wayland protocols and probably support soon to be merged in kwin.
Check here for how it is going

1 Like

That is good news. The frustrating part is even once the protocol is merged it’s going to take some time before it’s actually implemented under the various DE’s, which is somewhat frustrating when realistically speaking it’s a basic requirement more important than either HDR or VRR under Wayland.

I’m not entirely certain how such an important feature became such a low priority over HDR and VRR.

I had similar issue with fallout 4. I had to force pwarp in protontricks. You may want to do the same with your wine/proton. And probably run in gamescope for now and follow protondb if you havent already.

I understand the frustration, but it is already merged in wayland protocols and ready to merge in kwin, so I would expect it pretty soon.

I am just glad problems are being solved at least

I had the same issue with Fallout 4, I already applied the Protontricks tweak and it resolved the issue.

However I’m not really interested in Gamescope, the last time I tried it it introduced more problems than it resolved.

The pointer warp protocol isn’t really closely related to this, even if it might kind of work around the problem in some cases.

The problem is that most games are running through X11, and X11 does pointer locking very weirdly. Xwayland has some heuristics for detecting it and translating it to the proper Wayland API (which has been a thing for a decade), but sometimes that heuristic fails.

If it doesn’t happen on Xorg and you have a pretty consistent way to reproduce it, you could report it at Making sure you're not a bot! to maybe get the heuristics improved. It could also be the game or Wine doing stupid things, but I don’t know how to find out more about the X11 side of things.

2 Likes

I’ve been gaming under X11 for years, it’s definitely not a problem under X11. I’m trying to switch to Wayland, but honestly this is quite the deal breaker.

There has to be more people experiencing this problem, even under r/linux_gaming I see a number of people complaining about it. It’s by no means isolated, just play Fallout 4 without Protontricks and you’ll see it in seconds - and it’s not at all limited to Fallout 4.

It was actually a big problem regarding Counterstrike 2 running Wayland native until Valve patched the game to work around the problem.

Another point worth mentioning is that the issue happens under certain Linux native titles supporting Wayland native like Splitgate - The issue is in no way limited to Xwayland.

It’s also very likely that those “native” games use very old versions of SDL or such libraries, that don’t yet support the newer protocols, even if it was “solved” upstream.

It’s was happening under the native version of CS2 until Valve patched the game to work around the issue. CS2 isn’t an old game.

It’s a Wayland issue, and it shouldn’t exist. Under X11 it’s not a problem.

This is not a Wayland issue, I’m running under X11 and am still having CS2 lose control over my cursor on latest patch for native.

This is a Wayland issue that affects certain games, even Linux native games. It was a problem playing CS2 under native Wayland until Valve released a workaround update that resolved the issue:

I never experienced it when I was running CS2 under native X11, these days I’ve switched to Wayland 100%. If it’s something that’s recently become a problem playing CS2 under X11, perhaps file a bug report on the GitHub page: