Bug 343631 - With "buttons event handling" set to "turn off screen", screen does not turn off
Summary: With "buttons event handling" set to "turn off screen", screen does not turn off
Status: RESOLVED WORKSFORME
Alias: None
Product: Powerdevil
Classification: Plasma
Component: general (show other bugs)
Version: 5.2.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Development Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-31 19:15 UTC by Oded Arbel
Modified: 2020-12-07 12:41 UTC (History)
5 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 Oded Arbel 2015-01-31 19:15:35 UTC
Using "Energy Saving" configuration module, under "On AC Power", I've checked "Buttons events handling" and set "When laptop lid is closed" to "Turn off screen", but when I close the lid, I can still see that the screen is turned off as there is light leakage around the edge of the screen.

If I set it to "Lock screen", the screen does lock - but stays on.

My setting is also for the system to suspend if lid is closed when running on battery, and that works fine.

Reproducible: Always

Steps to Reproduce:
1. Under "Energy Saving" configuration, set screen to turn off when the lid is closed.
2. Close the lid

Actual Results:  
Screen stays on

Expected Results:  
Screen should turn off

Running the following script on my computer does seem to turn the screen off and on according to the lid state:

while true; do sleep 1; case $(awk '{print$2}' /proc/acpi/button/lid/LID0/state) in open) xset -display :0 dpms force on;; closed) xset -display :0 dpms force off;; esac; done

My system is: Dell Latitude E5440; NVidia Optimus; Kubuntu 15.04; NVidia Prime not installed and boot up display set to Intel.
Comment 1 Kai Uwe Broulik 2015-02-07 16:48:57 UTC
All notebooks I have experienced so far turn off their screen backlight hardware-wise when the lid is closed.

Can you check the output of
qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement org.kde.Solid.PowerManagement.isActionSupported DPMSControl
Comment 2 Martin Klapetek 2015-02-07 19:11:17 UTC
> All notebooks I have experienced so far turn off their screen backlight hardware-wise when the lid is closed.

Fwiw, my macbook pro 2011 does not do close-to-switch-off-lights-by-hardware. If there's no action configured, the light simply stays on (but I always configure suspend for that so not a problem for me).
Comment 3 Kai Uwe Broulik 2015-02-07 19:25:42 UTC
Thanks for the info!
So it might be desirable to always turn off the screen (I think DPMS affects all outputs, in case an external monitor is present, set brightness to zero) when closing the lid and turning it back on when the lid opens.
Comment 4 Oded Arbel 2015-02-08 09:48:22 UTC
(In reply to Kai Uwe Broulik from comment #1)
> Can you check the output of
> qdbus org.kde.Solid.PowerManagement /org/kde/Solid/PowerManagement
> org.kde.Solid.PowerManagement.isActionSupported DPMSControl

The output is "true".

Also, running `org.kde.Solid.PowerManagement.isLidClosed` in a loop  while I close and open the lid shows that the lid detection works fine.

Interesting behavior, which may or may not be related - if I close the lid and then open it again, then click the mouse anywhere on a plasma element (panel, desktop, but not the inside of an application window), then the screen turns off and immediately turns back on.

Here's the (trimmed and annotated) output of a loop displaying the output of running Solid's `IsLidClose` and `xset`s "DPMS" and "Monitor" status in a loop:

Lid closed: false,   DPMS is Enabled   Monitor is On ## we start with this
...
Lid closed: true,   DPMS is Enabled   Monitor is On ## closed the lid
...
Lid closed: false,   DPMS is Enabled   Monitor is On ## opened the lid
...
Lid closed: false,   DPMS is Enabled   Monitor is Off ## Clicked a task bar entry, screen blanks
Lid closed: false,   DPMS is Enabled   Monitor is Off ## Screen is now back on
...
And yes, the laptop's LCD screen is on, even though `xset` reports "Monitor is Off". If I turn off the battery applet's "Enable Power Management", then turn it back on, then `xset`s goes back to reporting "Monitor is On".

I've also managed, at one point, to have the screen actually turned off about 8 seconds after I closed the lid, but I couldn't reproduce - so it might be a combination of behaviors associated with the behavior described above, that I didn't manage properly.
Comment 5 Justin Zobel 2020-11-12 21:33:49 UTC
I've just tested this on my Dell Latitude with the latest Plasma and I cannot replicate this issue.

Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I'm setting status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
Comment 6 Oded Arbel 2020-11-14 11:51:03 UTC
Indeed - with Plasma 5.20.80, closing the lid does turn off the screen.

An interesting effect, which is unrelated to this report but I may open another report for: if I set "even when external monitor is connected" and close the lid while an external monitor is connected - the laptop screen turns off and the if the laptop screen is the main screen, the panel moves to the external monitor (which is fine). If I then opens the lid, the laptop screen turns on but it doesn't revert to the original configuration: it looks like a copy of the external monitor (I use different wallpapers for different screens) and doesn't get the main panel back.
Comment 7 Méven Car 2020-12-04 05:56:02 UTC
> An interesting effect, which is unrelated to this report but I may open another report for: if I set "even when external monitor is connected" and close the lid while an external monitor is connected - the laptop screen turns off and the if the laptop screen is the main screen, the panel moves to the external monitor (which is fine). If I then opens the lid, the laptop screen turns on but it doesn't revert to the original configuration: it looks like a copy of the external monitor (I use different wallpapers for different screens) and doesn't get the main panel back.

Please report it.
Comment 8 Oded Arbel 2020-12-07 12:16:48 UTC
(In reply to Méven Car from comment #7)
> Please report it.

I tested the "interesting effect" again, and I'm pretty sure this is caused by some legacy configuration that can no longer be reproduced with current kscreen: it happens only when the current Display Configuration UI has none of the screen with the "primary" checkbox checked, which I can no longer reproduce (My setup was from when the "primary" designation was a select box).
Comment 9 Oded Arbel 2020-12-07 12:41:55 UTC
I've opened bug 430107 for documenting that behavior, not that I think someone should invest time in "fixing" it.