SUMMARY The compositor very occasionally (git master) or always (5.24 branch) freezes when locking the screen. Per git bisect, the offending commit is https://invent.kde.org/plasma/kwin/-/commit/c16a8e09d7e80b2130a0ba041b62b956b8c8ceb3. If kscreenlocker emits aboutToLock and fails later, LockScreenPresentationWatcher still calls lockScreenShown, making the compositor believe the screen is locked. A similar possibility is when the first check in LockScreenPresentationWatcher never succeeds (due to screen configuration issues or because the greeter shows up before LockScreenPresentationWatcher runs, which are rare but possible) and the user unlocks within the 1000ms timeout. The case of 5.24 branch seems to be a simple mistake, where LockScreenPresentationWatcher is put in the 'unlocked' callback instead of the 'aboutToLock' one. (https://invent.kde.org/plasma/kwin/-/blob/9d38f57d84fb9a6f2c4e60f7051f685842f34e0f/src/wayland_server.cpp#L622) STEPS TO REPRODUCE 1. Lock screen. OBSERVED RESULT The screen becomes black. EXPECTED RESULT The compositor should work when unlocked or locking fails. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Debian testing KDE Plasma Version: git master / git 5.24.4 KDE Frameworks Version: 5.93.0 Qt Version: 5.15.3
Bug 451290 may be a manifestation of this race condition, just much harder to trigger. As long as dbus messages are handled in a different thread than the wayland server thread, there is a chance logind unlock callback gets scheduled earlier than lockScreenShown. The 1000ms timeout introduced in this commit makes the race condition much more likely to happen.
Git commit 388402c3b1b37d9f72597aae8d6670e8c0edeb14 by Xaver Hugl. Committed on 06/04/2022 at 19:08. Pushed by zamundaaa into branch 'Plasma/5.24'. waylandserver: move LockScreenPresentationWatcher to the correct place M +2 -2 src/wayland_server.cpp https://invent.kde.org/plasma/kwin/commit/388402c3b1b37d9f72597aae8d6670e8c0edeb14
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/2210
This should no longer be happening. If it's still an issue in Plasma 5.27, please reopen the bug report