Bug 415818 - Suggestion: enhance compositor auto suspend by window focus tracking condition
Summary: Suggestion: enhance compositor auto suspend by window focus tracking condition
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (other bugs)
Version First Reported In: git master
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-02 19:48 UTC by tempel.julian
Modified: 2023-11-11 22:44 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tempel.julian 2020-01-02 19:48:24 UTC
With KWin's auto suspend feature for compositing, the application has to actively tell the compositor to continue compositing when alt + tabbing out of a fullscreen window to have compositing again enabled for regular desktop usage.
The Proton fullscreen hack does this, but (m)any other applications don't. This is true for e.g. Feral's Linux ports like Shadow of the Tomb Raider. When alt + tabbing out of the game, compositing doesn't turn itself on again.

When switching out of a fullscreen window to the desktop (and any other window), the expectation is that compositing automatically turns on again until the user switches back to the fullscreen window, as desktop activity without compositor is a bad experience (tearing, no shadows, animations, transparency...). Also manually pressing keyboard buttons to do so is very inconvenient.

As Roman has reaffirmed recently, implementing unredirect for KWin Xorg is out of scope due developer resources being limited and Wayland not yet being where it should be (totally understandable point imho).

Now, perhaps there is room for a tradeoff that would require investing less efforts:
I wonder if the auto suspend feature could be enhanced so that KWin automatically turns compositing on again when alt + tabbing out of a fullscreen window (and vice versa)?

What if one more condition for turning off compositing was added: The application must not only tell KWin to suspend compositing, but its fullscreen window additionally also requires to have received focus before KWin actually does so. So KWin would e.g. poll each 0.5 seconds (or is there a better solution?) if the window requesting compositing to be suspended has focus (via FocusIn/Out events or _NET_WM_ACTIVE_WINDOW, which is offered as an option by Compton/Picom?). This should make sure that the compositor is always turned off when the fullscreen application is actually in use, while still maintaining compositing for desktop usage at the same time.

The feature for that kind of window tracking could be made available as a separate checkbox (which might be turned off by default).
This should make Plasma more attractive for people who game on Linux.

Thanks!
Comment 1 David Edmundson 2023-11-11 22:44:12 UTC
This is out of scope. 
Kwin scripting allows for this sort of thing should someone think it's a good idea