Bug 452344

Summary: On X11, automatically disabling compositing with unstable openGL setups makes the system seem broken and generates bug reports
Product: [Plasma] kwin Reporter: Nate Graham <nate>
Component: compositingAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: fake.name, katyaberezyaka, kde, mail, me, moritz1000, nonouser, samuelbernardo.mail, shalokshalom
Priority: VHI Keywords: usability
Version: git master   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.26
Sentry Crash Report:

Description Nate Graham 2022-04-06 19:11:09 UTC
KWin has some internal logic to disable compositing automatically after certain issues happen, and it sets OpenGLIsUnsafe=true in the user's ~/.config/kwinrc file.

This is fairly heavy-handed solution that makes the system seem broken and generates bug reports. For example:
- https://bugs.kde.org/show_bug.cgi?id=452193
- https://bugs.kde.org/show_bug.cgi?id=446779
- https://bugs.kde.org/show_bug.cgi?id=431161

We should try to avoid this if possible. If it's not possible, we need to be more proactive about telling the user what happened and letting them now how they can fix it. Sending a persistent system notification could work.
Comment 1 Nate Graham 2022-04-06 19:12:29 UTC
*** Bug 431161 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2022-04-06 19:12:38 UTC
*** Bug 446779 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2022-04-06 19:12:44 UTC
*** Bug 452193 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2022-08-04 17:36:03 UTC
*** Bug 432038 has been marked as a duplicate of this bug. ***
Comment 5 Nate Graham 2022-08-04 17:36:41 UTC
*** Bug 457384 has been marked as a duplicate of this bug. ***
Comment 6 Nate Graham 2022-08-04 17:38:00 UTC
Raising priority since this makes the system seem super broken when it happens.
Comment 7 Nate Graham 2022-08-30 19:52:06 UTC
*** Bug 458372 has been marked as a duplicate of this bug. ***
Comment 8 David Edmundson 2022-09-22 16:24:57 UTC
The more important issue isn't to show a notification but to make us try again. Especially for the case of just a bad driver + kernel combo.
We can compare the system boot time, and try again the next boot.
Comment 9 Bug Janitor Service 2022-09-23 12:48:36 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2992
Comment 10 Arjen Hiemstra 2022-09-27 10:56:59 UTC
Git commit 9a6c1e60e84f83f9f42f1b1519fe0964b8daf445 by Arjen Hiemstra.
Committed on 27/09/2022 at 10:23.
Pushed by vladz into branch 'master'.

X11 backend: Retry enabling compositing when it was disabled a while ago

This removes the "OpenGLIsUnsafe" flag and replaces it with a timestamp
that we can check to see how long ago we tried enabling compositing, so
we can retry it if a certain amount of time has elapsed.

M  +16   -8    src/backends/x11/standalone/x11_standalone_platform.cpp
M  +2    -2    src/kcmkwin/kwincompositing/kwincompositing_setting.kcfg
M  +1    -1    src/kcmkwin/kwincompositing/kwincompositingdata.cpp
M  +2    -2    src/kcmkwin/kwincompositing/main.cpp
M  +3    -0    src/kwin.kcfg

https://invent.kde.org/plasma/kwin/commit/9a6c1e60e84f83f9f42f1b1519fe0964b8daf445
Comment 11 Vlad Zahorodnii 2022-09-27 11:01:46 UTC
Git commit 8d0be8e469dff0ce409f491b0a62cb428e277190 by Vlad Zahorodnii, on behalf of Arjen Hiemstra.
Committed on 27/09/2022 at 11:01.
Pushed by vladz into branch 'Plasma/5.26'.

X11 backend: Retry enabling compositing when it was disabled a while ago

This removes the "OpenGLIsUnsafe" flag and replaces it with a timestamp
that we can check to see how long ago we tried enabling compositing, so
we can retry it if a certain amount of time has elapsed.


(cherry picked from commit 9a6c1e60e84f83f9f42f1b1519fe0964b8daf445)

M  +16   -8    src/backends/x11/standalone/x11_standalone_platform.cpp
M  +2    -2    src/kcmkwin/kwincompositing/kwincompositing_setting.kcfg
M  +1    -1    src/kcmkwin/kwincompositing/kwincompositingdata.cpp
M  +2    -2    src/kcmkwin/kwincompositing/main.cpp
M  +3    -0    src/kwin.kcfg

https://invent.kde.org/plasma/kwin/commit/8d0be8e469dff0ce409f491b0a62cb428e277190
Comment 12 Vlad Zahorodnii 2022-10-28 09:38:49 UTC
Git commit b30e81cb22d604146a20ca556b14018dd9a98bf2 by Vlad Zahorodnii.
Committed on 28/10/2022 at 09:38.
Pushed by vladz into branch 'master'.

x11: Keep compositing mode untouched if kwin crashes

kwin can crash for reasons that have nothing to do with compositing. If
that's the case, after two crashes compositing will be permanently
disabled and you would need to go to system settings to reenable it, the
timestamp based check in the x11 backend won't be effective.

M  +0    -6    src/main_x11.cpp

https://invent.kde.org/plasma/kwin/commit/b30e81cb22d604146a20ca556b14018dd9a98bf2