Bug 475866

Summary: Default configuration of "Suspend session" is invalid
Product: [Applications] systemsettings Reporter: dengr1065
Component: kcm_powerdevilAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED FIXED    
Severity: minor CC: kde, natalie_clarius, nate
Priority: NOR    
Version First Reported In: 5.27.8   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.27.9
Sentry Crash Report:

Description dengr1065 2023-10-20 08:05:08 UTC
SUMMARY
If the "Suspend session" checkbox in "Energy Saving" settings is turned off and the user navigates to a different settings section, the previously set configuration is forgotten. Once "Suspend session" is enabled again, there is no action selected and the configuration does nothing.

STEPS TO REPRODUCE
1. Open System Settings.
2. Navigate to "Power Management" -> "Energy Saving".
3. Uncheck the "Suspend session" checkbox.
4. Apply new settings.
5. Navigate to any other section, such as "Activity Power Settings".
6. Navigate back to "Energy Saving".
7. (Optionally) Enable "Suspend session".
8. The options are set to "Automatically [ ] [after 10 min]".

OBSERVED RESULT
No action is selected in the default configuration, so enabling the setting does nothing.

EXPECTED RESULT
The default action is set to a reasonable default, such as "Sleep".

SOFTWARE/OS VERSIONS
Operating System: Gentoo Linux 2.14
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.1.57-gentoo (64-bit)
Graphics Platform: Wayland
Comment 1 Bug Janitor Service 2023-10-22 20:07:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/powerdevil/-/merge_requests/260
Comment 2 dengr1065 2023-10-22 20:43:18 UTC
Git commit 4de98e9b0feae7057a081138977e17bbca05173d by Danyil Hryhoriev.
Committed on 22/10/2023 at 21:38.
Pushed by nicolasfella into branch 'master'.

Provide a default action in Suspend session config

Makes sure that checking "Suspend session" in System Settings -> Energy
Saving does something without any further configuration. The default
action is to suspend to RAM if it's possible, otherwise it defaults to
shutting down the system.

M  +4    -1    daemon/actions/bundled/suspendsessionconfig.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/4de98e9b0feae7057a081138977e17bbca05173d
Comment 3 Nicolas Fella 2023-10-22 20:56:13 UTC
Git commit d176188ff9b573a784905cada8824897af86b34b by Nicolas Fella, on behalf of Danyil Hryhoriev.
Committed on 22/10/2023 at 22:45.
Pushed by nicolasfella into branch 'Plasma/5.27'.

Provide a default action in Suspend session config

Makes sure that checking "Suspend session" in System Settings -> Energy
Saving does something without any further configuration. The default
action is to suspend to RAM if it's possible, otherwise it defaults to
shutting down the system.
(cherry picked from commit 4de98e9b0feae7057a081138977e17bbca05173d)

M  +4    -1    daemon/actions/bundled/suspendsessionconfig.cpp

https://invent.kde.org/plasma/powerdevil/-/commit/d176188ff9b573a784905cada8824897af86b34b