Bug 417502 - Sleep does not work if you close the laptop lid too fast after specifying that you want to power off.
Summary: Sleep does not work if you close the laptop lid too fast after specifying tha...
Status: REPORTED
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.18.0
Platform: Neon Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-02-12 16:12 UTC by John van Spaandonk
Modified: 2020-02-13 05:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John van Spaandonk 2020-02-12 16:12:56 UTC
SUMMARY
My laptop is set up to power off if I press the power button, and to go to sleep if I close the laptop lid. No screensaver active when the problem occurs. Also no full-screen video.

STEPS TO REPRODUCE
1. Press power button to put laptop to sleep
2. Close laptop lid directly after pressing power button
3. that's it!

OBSERVED RESULT
Laptop goes to sleep (suspend?), apparently erroneously triggered by closing  the laptop lid.

EXPECTED RESULT
The laptop should power off. I asked it to and it should not ignore it and do something else instead.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
This bug has been there for years. It looks like the developers did not test this scenario.
No idea if the problem is in Powerdevil or not, feel free to reassign to appropriate component. Also let me know what other info you want!
Comment 1 Kai Uwe Broulik 2020-02-12 16:15:55 UTC
There's definitely code in Powerdevil that checks if ksmserver is exiting and then ignores the suspend request.
Possible that PowerDevil at this point was already killed and then logind takes over and just goes ahead anyway.
Comment 2 John van Spaandonk 2020-02-13 05:49:10 UTC
On 2020-02-12 17:15, Kai Uwe Broulik wrote:
> https://bugs.kde.org/show_bug.cgi?id=417502
>
> Kai Uwe Broulik <kde@privat.broulik.de> changed:
>
>             What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                   CC|                            |kde@privat.broulik.de
>
> --- Comment #1 from Kai Uwe Broulik <kde@privat.broulik.de> ---
> There's definitely code in Powerdevil that checks if ksmserver is exiting and
> then ignores the suspend request.
> Possible that PowerDevil at this point was already killed and then logind takes
> over and just goes ahead anyway.
>
I think that powermanagement in particular benefits from a system-wide 
development view.
Too bad I do not have any experience with this.
As a first step, is this problem reproducable?