Bug 317271

Summary: closing laptop lid does not always result in sleep
Product: [Unmaintained] solid Reporter: Roland Leißa <roland.leissa>
Component: powermanagementAssignee: Dario Freddi <drf>
Status: RESOLVED UNMAINTAINED    
Severity: critical CC: afiestas, oliver.henshaw, walch.martin
Priority: NOR    
Version First Reported In: 5.3.0   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Roland Leißa 2013-03-24 13:28:14 UTC
In System Settings -> Power Management -> Energy Saving
I have in all three tabs "On AC Power", "On Battery", "On Low Battery" the following setting:
- "Button events handling" checked
- "When laptop lid closed" -> "Sleep"

Reproducible: Sometimes

Steps to Reproduce:
1. Use settings mentioned above
2. Close Laptop lid
Actual Results:  
Screen gets locked but laptop does not sleep

Expected Results:  
Laptop sleeps

I can almost always trigger this bug, when I do the following:
1. Remove AC adapter
2. Immediately close laptop lid 


Sometimes, when sleeping works, I awake may laptop, and then it will immediately go to sleep again. This bug may be related or a different bug.


I think this a KDE bug (and not a kernel bug or so) because in enlightenment e17 sleeping works as expected.


I consider this bug critical for two reasons:
1. Because the laptop is not sleeping, it will at some point run out of battery -> data loss
2. When the laptop runs happily after having closed the lid, some laptops may get problems with cooling, especially when you put your laptop in your bag believing it is actually sleeping. This may cause hardware defects.
Comment 1 Oliver Henshaw 2013-04-10 12:12:50 UTC
What settings do you have in System Setting -> Power Management -> Advanced settings?
Comment 2 Roland Leißa 2013-04-21 16:29:13 UTC
Battery is at low level at 50%
Battery is at critical level at 5%
When battery is at critical level Hibernate
Lock screen on resume <checked>
Never prevent an action on lid close <checked>
Comment 3 Roland Leißa 2013-04-21 16:33:10 UTC
Since kde 4.10.2 or so the bug seems to be fixed -- I did not have any issues.
Also, I discovered that ktorrent has this complete idiotic switch "supress sleep whan torrents are running" -- which is even checked per default.
Comment 4 Roland Leißa 2013-04-28 01:36:52 UTC
sometimes this issue still occurs. I definitely had no ktorrent running.
Comment 5 Roland Leißa 2013-05-02 14:13:04 UTC
switching off "lock screen on resume" certainly increases the likelyhood that sleep does not work.
Comment 6 Christoph Feck 2013-05-13 21:44:54 UTC
Olivier, do you need additional information to investigate this issue? Please set the status.
Comment 7 Oliver Henshaw 2013-05-17 13:50:14 UTC
Can you add "kded" (not "7020 kded4": logout and in if it doesn't appear) in kdebugdialog (and logout/in again). Then attach the output of 'tail -f .xsession-errors' when you close the lid.
Comment 8 Alex Fiestas 2013-07-29 16:26:47 UTC
This issue should be fixed now, Nobody can inhibit "Lid close" plus the "dead lock" we had has been fixed.

Please, if you can still reproduce this in 4.10.5 or 4.11 feel free to reopen the bug providing the information Oliver asked.

Thanks for reporting !
Comment 9 Roland Leißa 2013-07-29 17:19:17 UTC
This issue very rarely still occured (but then I had never the log output at hand... Murphy's Law). Anyway, I'm now on 4.11. I'll reopen this bug if the problem persists.

Thank your for your support.
Comment 10 Alex Fiestas 2013-07-29 18:20:52 UTC
Thanks! if it happens with 4.11 don't hesitate to reopen the bug!
Comment 11 Roland Leißa 2013-09-01 10:11:05 UTC
bug still persists. I finally got the output or my  .xsession-errors: 

kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) KeyboardConfig::load: configuring layouts true configuring options true
kded(18687) X11Helper::getGroupNames: Fetched layout groups from X server:      layouts: ("de", "us")   variants: ("nodeadkeys", "")
kded(18687) StatusNotifierWatcher::serviceUnregistered: Service  "org.kde.StatusNotifierItem-18674-1" unregistered
kded(18687) BlueDevilDaemon::monolithicFinished:
kded(18687) BlueDevilDaemon::executeMonolithic:
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave.
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

kded(18687) StatusNotifierWatcher::RegisterStatusNotifierItem: Registering "org.kde.StatusNotifierItem-19400-1/StatusNotifierItem" to system tray
kded(18687) Solid::Control::WirelessNetworkInterfaceEnvironment::~WirelessNetworkInterfaceEnvironment:
QGridLayoutEngine::addItem: Cell (0, 1) already taken
QGridLayoutEngine::addItem: Cell (0, 1) already taken
QGridLayoutEngine::addItem: Cell (0, 1) already taken
QGridLayoutEngine::addItem: Cell (0, 1) already taken
QGridLayoutEngine::addItem: Cell (0, 1) already taken
QGridLayoutEngine::addItem: Cell (0, 1) already taken
Comment 12 Roland Leißa 2014-03-30 21:26:32 UTC
Anything new here? Bug still persists in KDE 4.12.97
Comment 13 Jonathan Riddell 2015-03-11 19:17:57 UTC
This bug is reported on libsolid which is the kdelibs4 version of the solid library.  It is now in maintenance mode.  If you think it should still be fixed in the KDE Frameworks 5 version of solid please move it to or report a bug on frameworks-solid or Powerdevil.
Comment 14 Roland Leißa 2017-11-21 15:29:26 UTC
Bug is still present on current version of solid.
Comment 15 Andrew Crouthamel 2018-09-04 15:48:59 UTC
Hello! Sorry to be the bearer of bad news, but this project has been unmaintained for many years so I am closing this bug. Please try again with the latest version and submit a new bug to frameworks-solid if your issue persists. Thank you!