Bug 435223 - Allowing disabling composition for the current session without login out
Summary: Allowing disabling composition for the current session without login out
Status: RESOLVED WORKSFORME
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: git master
Platform: Manjaro Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-01 16:28 UTC by Alberto Salvia Novella
Modified: 2021-04-06 13:08 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Salvia Novella 2021-04-01 16:28:05 UTC
There's the option "enable compositor on startup", but once composition is enabled in the current session there's no way to turn it off except by disabling that first option and login off.

Most likely it would be better having that option as "enable composition" alone.
Comment 1 David Edmundson 2021-04-01 16:55:27 UTC
FYI, there's a configurable keyboard shortcut alt+shift+f12.

Can you confirm your use-cases? Is it game performance?
Comment 2 Alberto Salvia Novella 2021-04-01 16:59:56 UTC
It's just that, process wise, the extra step of having to log off seems wasteful.
Comment 3 Nate Graham 2021-04-02 00:03:05 UTC
As David said, Alt+Shift+F12 will do it on demand.

FWIW games are supposed to inhibit compositing automatically. Cases where this doesn't happen are other bugs, most likely in those games themselves.
Comment 4 Alberto Salvia Novella 2021-04-02 13:22:04 UTC
Doing it by a shortcut, and not by an option in the panel, is quite surprising.
Comment 5 Nate Graham 2021-04-02 14:02:52 UTC
Manually toggling compositing isn't the kind of thing that an average user ever care about, so offering a GUI way to do it would only offer them another way to shoot themselves in the foot. The option is there for people who really want it. "Simple by default, powerful when needed." :)
Comment 6 Alberto Salvia Novella 2021-04-02 14:16:44 UTC
Not allowing toggling composition, but allowing all other kinds of things like the opengl version you use and the scaling technique?

Sorry, I disagree. It's poorly designed.
Comment 7 Alberto Salvia Novella 2021-04-04 06:03:57 UTC
Okay, that was easy: only re-enabling composition after 10 seconds of being non full-screen prevented 95% of glitches.

Even better: done by checking the status of the current window without using polling, but interruptions.

It seems that, as usual, I will be taking all the credit:
https://gitlab.com/es20490446e/kwin-autocomposer/-/blob/master/root/usr/share/kwin-autocomposer/kwin-autocomposer
Comment 8 Nate Graham 2021-04-05 00:59:18 UTC
(In reply to Alberto Salvia Novella from comment #7)
> It seems that, as usual, I will be taking all the credit:
Excuse me good sir, so you have a license for an ego of this size?
Comment 9 Alberto Salvia Novella 2021-04-05 01:46:36 UTC
By the way I have figured out an even better algorithm to do this. Now:

- Entering or leaving full-screen instantly toggles composition. You can't even see the transition.
- Composition isn't re-enabled if the full-screen window loses focus, till that window is closed.
- Applications started as windowed don't automatically block composition when maximized, for example web-browsers.
- No perceivable use of CPU or IO on the system monitor.

The trick was simple: only re-test for full-screen if the last known full-screen window is no longer full-screen.

Everything is done in memory for maximum performance, and only iterated on window focus change.

Solving problems that no bunch of people were able to solve in the last 20 years, with a few lines, is the license of being awe.

https://gitlab.com/es20490446e/kwin-autocomposer/-/blob/master/root/usr/share/kwin-autocomposer/kwin-autocomposer
Comment 10 Nate Graham 2021-04-05 02:10:03 UTC
If you feel that your work could be useful to others, feel free to upload it as  KWin script on store.kde.org.
Comment 11 Alberto Salvia Novella 2021-04-05 03:05:46 UTC
Umm, I don't know. I will think about that 🤔
Comment 12 Alberto Salvia Novella 2021-04-06 13:08:16 UTC
You were right, much better as kwinscript. Thanks for the suggestion:

https://store.kde.org/p/1502826/