Bug 306448 - Game mode
Summary: Game mode
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: 4.9.1
Platform: unspecified Linux
: NOR task
Target Milestone: 4.11
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-08 11:53 UTC by Martin Flöser
Modified: 2013-05-19 11:06 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Flöser 2012-09-08 11:53:40 UTC
KWin should go into a benchmark mode when the PTS is run. It should be possible to ship a window specific rule to block compositing for the games of PTS.
Comment 1 Martin Flöser 2012-09-08 14:52:21 UTC
This is not only useful for PTS, but would also be quite a nice thing to have for all (known) games. Given that rules might be difficult to update automatically a script might be easier. Maybe there's a way to automatically recognize all wine and steam games?
Comment 2 Thomas Lübking 2012-09-08 19:26:36 UTC
Wine apps have ClassClass "Wine" - do do all other wine applications (winrar etc. or whatever ppl. use) - notice that not all wine games will trigger a correct fullscreen mode

SDL apps are not really detectable but might often (unlike usually wine games) grab the mouse (many games may) in FS mode.

Then there are the id games. And their uncountable amount of FOSS variants (using SDL as backend - or not, often even ship two variants - leading to different window props)

The Unreal engine.

Dosbox, scummvm and other emulators.

"Casual" games (pingus, supertux, tuxracer, that bubble timekiller, neverball, some billiard game, ltris, briquolo, armagetron, hedgewars, ...)

Strategy games.

The lokigame ports.

There are certainly n hundred relevant games out there, do you want to ship n hundred rules in case someone has game x installed?

What about eg. celestia? It will fit many most game criteria - yet has a menubar ... 

What about video players? They don't fit the major criteria (GL, no popups) yet might profit a lot when you suspend compositing while watching a movie for 2h - and if it's just battery.

A solution might be a GHNS database for such blocking rules (so ppl don't have to run after window properties) issue is that the props might change every now and then... and vary between distro shipped releases

It would be _much_ simpler and more robust if apps in question just set the property (also remind the mail from the mutter guys) - or ppl toggle compositing around games :-(

-> What about a flag on clients?
When entering fullscreen and there's no state break in the next 30secs, just suspend the compositor (doesn't fix issues with two parallel contexts or so but still boosts performance)
As soon as there's a state break (ie. a popup shows up, NOTICE that our fullscreen criteria are still wrong) resume compositing and flag the client to not break compositing for its fullscreen state.
The rule could accomplish that (ie. you can still have clients block compositing despite the state was broken and you can also enforce not blocking the compositor on this client)

Pros compared to current situation:
- better game performance than unredirecting
- only one flicker on fullscreen browser showing a popup

Cons compared to current situation, resp.. remaining question:
- what to do with corner action effects? 
  shortcuts for present windows etc. is no big deal -> reactivate the compositor and keep it active but really the very last thing you want to happen while fighting some Mutants is the present windows effect kicking in because the game doesn't grab the mouse and you reached a corner.
Comment 3 Martin Flöser 2012-09-08 19:47:16 UTC
That doesn't sound like there's an easy way. Nevertheless I will install a few games and look at the properties. Hopefully the problem also solves itself once the GNOMEs have updated the spec (e.g. Wine implementing the hint already existing in the Windows API).
Comment 4 Martin Flöser 2012-09-09 06:18:51 UTC
so I installed as a test openarena and nexiuz. The one uses "ioquake3" the other "darkplaces" as window class

Both are SDL games and have problems going to fullscreen.
Comment 5 Martin Flöser 2013-05-18 18:30:55 UTC
stupid idea. Let's hope for windows setting the correct hints and let's implement the new hints.
Comment 6 Thomas Lübking 2013-05-18 19:17:03 UTC
FTR: there's a pending(?) RR to enable FS unredirection only for override redirect windows, claiming the SDL case.

-> we could twist the block rule logics for override_redirects (ie.true by default, false by rule)
Comment 7 Thomas Lübking 2013-05-19 11:06:54 UTC
(In reply to comment #6)
> FTR: there's a pending(?) RR to enable FS unredirection

https://git.reviewboard.kde.org/r/110088/
Just checked, D3 and Q4 are override redirects, but io* (ioquake etc) is not.
Wine games are override_redirect, but not "fullscreen" (but screen-(1,1))

And of course i again forgot that unmanged are not ruled, what doesn't matter since the managed wine window with the proper title (and wine class) is not the "fullscreen" game window ... WAAHHH... :-(