Bug 396439

Summary: Setting do nothing on lid close prevents laptop from shutting down
Product: [Plasma] Powerdevil Reporter: David <david.cortes.rivera>
Component: generalAssignee: Plasma Bugs List <plasma-bugs>
Status: CONFIRMED ---    
Severity: normal CC: bugseforuns, kde, nate, tmn505, xerusx
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed In:

Description David 2018-07-12 13:53:32 UTC
After configuring a laptop to not do anything on lid close, if I close the lid while it's shutting down, oftentimes it will not shutdown, but rather block the session, and shutdown tight after opening the lid and entering my user password. This didn't happen in earlier releases of plasma.

Steps to reproduce:
* Go to System Settings -> Power Management -> Energy Saving.
* For the three modes - On Ac Power, On Battery, On Low Battery - tick "Button events handling", and set "When laptop lid closed" to "Do nothing".
* Connect the laptop to AC Power.
* Shut it down from KDEs shutdown menu (e.g. Ctrl + Alt + Del -> select "Shutdown").
* Close the lid while the laptop is shutting down.

Expected behavior:
* Laptop should shut down.

Actual Behavior:
* Sometimes it doesn't shutdown, but rather, it turns to the login screen, and once the user opens the lid and puts the user password, it immediately shuts down.

Reproducible: sometimes.

Setup: Plasma desktop 5.13.2, Frameworks 5.47, QT 5.10.1, kernel 4.16.0-2, running on Debian buster/sid.
Comment 1 Patrick Silva 2018-09-15 16:43:46 UTC
Tried some times on my laptop running neon dev unstable.
Shutdown failed in most attempts, my system did logout instead when lid was closed.
When lid was open, login screen (sddm) appeared, I entered my password and a new plasma session was started (splash screen shown up).
Comment 2 Janek 2019-07-29 13:34:07 UTC
"it doesn't shutdown, but rather, it turns to the login screen, and once the user opens the lid and puts the user password, it immediately shuts down"

I am experiencing this reliably everytime, but this only started recently for me. I use KDE Neon with latest Plasma (5.16.3). It is super annoying.
Comment 3 T M Nowak 2019-08-02 10:05:32 UTC
I also experience this sometimes.
This is an issue between powerdevil and logind. When user triggers shutdown and powerdevil is exited, its power settings/overrides no longer apply. Then logind takes over the lid switch management. If the lid is closed early enough in the shutdown process then it invokes a sleep instead, which is default behaviour for logind.
The workaround to this would be changing:

#HandleLidSwitch=suspend

to

HandleLidSwitch=ignore

in /etc/systemd/logind.conf.
Comment 4 Janek 2019-08-08 11:09:26 UTC
Thank you very much Nowak! This is the automated way of doing it, for anyone interested ;)


sudo sed -i 's/#HandleLidSwitch=suspend/HandleLidSwitch=ignore/' /etc/systemd/logind.conf

Of course, it would be ideal if powerdevil could synchronize it's setting to logind so the user doesn't have to bother.
Comment 5 David 2021-10-23 19:45:02 UTC
I see that nowadays there are some settings which prompt for a root password. Would a fix be possible to implement in the settings app by now?