When I play War Thunder in full-screen mode, with Shake Pointer enabled, it activates, if I shake my cursor. [1] This causes me to gain two cursors. Is this expected?
Food for thought: how does KWin know you’re playing a game?
With no technical knowledge, I would answer: it probably doesn’t!
Nevertheless, I can think of 2 behaviours games usually use and KWin should be aware:
- Being full-screened and possibly setting hints for presentation model, namely regarding vsync, direct scan-out, screen tearing and the likes;
- Taking control of the cursor and asking/forcing it to disappear to draw their own custom cursor.
The issue is these behaviours are not limited to games (other fullscreen apps, custom cursors on digital creation software) nor are sufficient as some games can be non-fullscreened, and not asking anything.
At least for cursors, if it’s using the default, having Shake Pointer activating shouldn’t be an issue.
It could probably catch most cases if it were to watch for Gamemode, certainly not a perfect solution, but I think a lot of Steam games set it. Or it could just be me.
@AdamKafei, if it can filter what Steam designates as “Tools” out. Though, any application can override the cursor. I suppose that what I’m asking is whether kwin is able to detect when an application overrides the cursor.
The problem with these “guess if a game is running” heuristics is they can’t be 100% accurate.
That means at the margins, the detection will fail and users will be confused, because it seems to work most of the time. The result is unfixable bug reports, and users’ inability to discern the pattern behind why it sometimes works and sometimes doesn’t, which makes the entire system feel fragile.
Maybe it should be a Wayland function? An API or some such that software can can signal to say “I am a thing and would like considerations A, B, C, Etc”?
Some kind of standard API for this would be the reliable way to do it, yeah.
Of course that suffers from another problem: getting every game ever made to implement that signal. Most won’t, notably including all the old unmaintained games.
Every game ever made might be a bit ambitious, but getting Valve and GOG on board (I expect the Linux only launchers would pick it up if word were spread) would cover the majority of cases and I might be wrong but I don’t imagine it’d be too hard for Steam to signal that API when ‘it’ is running a game.
It’s not perfect, but if the facility is universally available, it should be good enough right?
Edit:
To this point, I imagine Valve would handle this either by directly setting default behaviour or by making a launch command/setting available.
@AdamKafei, it could be a regression (accessibility-wise) for games that don’t override the cursor, though, and would be applicable to any application that does. It’s solely applicable to those that override the cursor. I’d say that, whenever KWin decides to hide the cursor, that should be when the Shake Pointer effect should be disabled.
That puts me in mind of KWin’s Adaptive Sync: You can set it always on, always off or automatic where it switches on when the system believes it’s needed. Similarly default behaviour for this could be that Shake Pointer is disabled in games and/or when the cursor is hidden/overridden (though mostly I think that again is in games so maybe redundant) but you can set it “Always On” or words to that effect or switch it off completely (as I have because it was unhelpful too often).
I fully understand that’s possibly more work than it’s worth, perhaps fortunately however that’s not for me to decide. I’m sure there are cleverer people than me who actually design and make these sorts of things who will figure something out if need be.