Bug 407093

Summary: Laptop suspends even if external monitor is plugged in
Product: [Unmaintained] Powerdevil Reporter: neopt
Component: generalAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.15.3   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: powermanagementprofilesrc

Description neopt 2019-04-30 13:54:39 UTC
Created attachment 119746 [details]
powermanagementprofilesrc

SUMMARY
On the systems settings module, I set the laptop lid close action to "Suspend", and unchecked the box "Even when external monitor is connected".
Powerdevil seems to ignore this setting and suspend the laptop whether an external monitor is plugged or not when I shut the lid.

STEPS TO REPRODUCE
1. Plug in external monitor 
2. Close lid

OBSERVED RESULT
System enters suspended state

EXPECTED RESULT
External monitor inhibits suspension.


SOFTWARE/OS VERSIONS
Operating System: NixOS 19.09pre177249
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.0
Kernel Version: 4.19.36
OS Type: 64-bit


ADDITIONAL INFORMATION
The issue appears to be a regression - before installing the last updates it worked just fine. Unfortunately I cannot rollback to the previous version easily to confirm this.

$ systemd-inhibit
     Who: UPower (UID 0/root, PID 2754/upowerd)
    What: sleep
     Why: Pause device polling
    Mode: delay

     Who: PowerDevil (UID 1000/salazar, PID 2995/org_kde_powerde)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
     Why: KDE handles power events
    Mode: block

     Who: Screen Locker (UID 1000/salazar, PID 2917/ksmserver)
    What: sleep
     Why: Ensuring that the screen gets locked before going to sleep
    Mode: delay

3 inhibitors listed.

$ busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager Docked
b true

$ xrandr  | grep " connected"
eDP-1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 309mm x 174mm
DP-1-2 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 521mm x 293mm

$ journalctl -f
[...]
Apr 30 15:47:51 hostname systemd-logind[2229]: Lid closed.
Apr 30 15:47:51 hostname xsession[2806]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("Type", QVariant(uint, 1)))
Apr 30 15:47:51 hostname xsession[2806]: powerdevil: Suspend session triggered with QMap(("Explicit", QVariant(bool, true))("SkipFade", QVariant(bool, true))("Type", QVariant(uint, 1)))
Apr 30 15:47:51 hostname xsession[2806]: powerdevil: Starting Login1 suspend job
Apr 30 15:47:51 hostname xsession[2806]: lock called
Apr 30 15:47:51 hostname xsession[2806]: powerdevil: Pausing all media players before suspending
Apr 30 15:47:51 hostname xsession[2806]: bluedevil: About to suspend
[...]
Comment 1 neopt 2019-04-30 14:00:28 UTC

*** This bug has been marked as a duplicate of bug 407094 ***