If a sleep inhibitor lock is repeatedly created and released during the duration of the "Screen Energy Saving" switch off period, the screen will never switch off on inactivity. I believe this is unintended behavior based on the similar Bug 464119; screen switch off and sleep should not be correlated. *** STEPS TO REPRODUCE 1. Set the "Screen Energy Saving" to switch off after 1 minute in Power Devil 2. Run the below script as root: ``` #!/bin/bash if (( $EUID != 0 )); then echo "Must run as root" exit 1 fi trap exit 1 SIGINT while true; do systemd-inhibit --what="sleep" --who="test" --why="test" --mode="block" sleep 5 done ``` OBSERVED RESULT Screen will not switch off after 1 minute of inactivity. EXPECTED RESULT Screen should switch off after 1 minute of inactivity. SOFTWARE/OS VERSIONS Linux/KDE Plasma: Gentoo (up to date stable branch 5-10-2023) KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.104.0 Qt Version: 5.15.9 ADDITIONAL INFORMATION Similar behavior was observed on Debian 12, in this case the screen shut off momentarily and seconds later switched back on without any human interaction. Linux Version: Debian 12 KDE Plasma Version: 5.27.2 KDE Frameworks Version: 5.103.0 Qt Version: 5.15.8
Can't reproduce on: Operating System: Kubuntu 23.10 KDE Plasma Version: 5.27.8 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.10 Kernel Version: 6.5.0-10-generic (64-bit) Graphics Platform: Wayland My screen turned off just a bit more than a minute later which seemed to be in the expected 60-65 seconds range with the reproducer steps, and `systemd-inhibit --list` confirms the inhibitor's existence even after waking up screen.
I'm now unable to reproduce on: Operating System: Gentoo Linux 2.14 KDE Plasma Version: 5.27.8 KDE Frameworks Version: 5.110.0 Qt Version: 5.15.11 Kernel Version: 6.1.53-gentoo-r1 (64 bit) Graphics Platform: Wayland I recommend closing. I'm not sure if something was up streamed which would affect behavior here. So I will leave it to someone with more experience with this project to tag resolution. Thank you.
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kscreenlocker/-/merge_requests/263
Git commit 6e1bff77a76ec89be797749a1408b1cd5451c5ec by David Redondo. Committed on 05/02/2025 at 16:21. Pushed by davidre into branch 'master'. Remove and add idle timeout when inhibited and unhibited Ensures that when a dbus inhibition is lifted the idle time starts anew. Otherwise a new idle timeout would not start until user activity and we would never lock. The stored type of the the timeout is changed to double to make testing with shorter timeouts possible. M +1 -0 autotests/CMakeLists.txt M +94 -0 autotests/ksldtest.cpp M +27 -12 ksldapp.cpp M +3 -6 ksldapp.h M +4 -1 powermanagement_inhibition.cpp M +2 -0 powermanagement_inhibition.h M +1 -1 settings/kscreenlockersettings.kcfg https://invent.kde.org/plasma/kscreenlocker/-/commit/6e1bff77a76ec89be797749a1408b1cd5451c5ec
Git commit 763721d8a22a4e564dc0ef43d58257b1d57f11a7 by David Redondo. Committed on 06/02/2025 at 08:33. Pushed by davidre into branch 'Plasma/6.3'. Remove and add idle timeout when inhibited and unhibited Ensures that when a dbus inhibition is lifted the idle time starts anew. Otherwise a new idle timeout would not start until user activity and we would never lock. The stored type of the the timeout is changed to double to make testing with shorter timeouts possible. (cherry picked from commit 6e1bff77a76ec89be797749a1408b1cd5451c5ec) Co-authored-by: David Redondo <kde@david-redondo.de> M +1 -0 autotests/CMakeLists.txt M +94 -0 autotests/ksldtest.cpp M +27 -12 ksldapp.cpp M +3 -6 ksldapp.h M +4 -1 powermanagement_inhibition.cpp M +2 -0 powermanagement_inhibition.h M +1 -1 settings/kscreenlockersettings.kcfg https://invent.kde.org/plasma/kscreenlocker/-/commit/763721d8a22a4e564dc0ef43d58257b1d57f11a7
can you please confirm that the commit to fix this hasn't resulted in this bug here: https://bugs.kde.org/show_bug.cgi?id=499637