! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Laptop lid action not respected
Status:
RESOLVED: FIXED
Product:
Xfce4-power-manager
Component:
General

Comments

Description sca957 2019-04-18 02:54:57 CEST
Xfce4-power-manager not respecting laptop lid setting.  Regardless of power manager setting (Switch off display or Lock screen), closing the lid always results in suspend on ac or battery.  Oddly, this used to work for me a few months ago.

Per ToZ "I would suggest creating a bug report and seeing if a developer will have a deeper look."

I have tried:
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -s false
and
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -n -t bool -s false
No difference all actions still = suspend

downgrading upower 0.99.10-1 > 0.99.9-1
No difference all actions still = suspend

upgrading xfce4-power-manager 1.6.1 > xfce4-power-manager-git 1.6.1+164
No difference all actions still = suspend

xfdesktop -V:
This is xfdesktop version 4.13.3, running on Xfce 4.12.
Built with GTK+ 3.24.7, linked with GTK+ 3.24.8.
Build options:
    Desktop Menu:        enabled
    Desktop Icons:       enabled
    Desktop File Icons:  enabled

OS: Antergos
Kernel: 5.0.7
Comment 1 Theo Linkspfeifer editbugs 2019-04-18 21:28:20 CEST
Similar report: https://bugzilla.xfce.org/show_bug.cgi?id=15151
Comment 2 sca957 2019-05-27 21:57:56 CEST
Update:
Power manager 1.6.2-1 has a minor improvement.  If both "On Battery" and "Plugged In" are set to: Switch off display
then lid action is as expected on either battery or AC.

However, any other combination results in Suspend.  I can work with this.
Adding this note to the bug report.
Comment 3 Wayne Walker 2019-09-25 20:03:46 CEST
I am seeing this problem on my notebook.  

xfce4-power-manager-1.6.5-1.fc30.x86_64

I'm on Fedora 30 XFCE spin. In Applications->Settings->Power->Plugged In->"Laptop lid is closed" is set to "Lock Screen" ; yet every time I close the lid it suspends.

And it doesn't lock the screen.

I want it to suspend on battery, But just to lock the screen when plugged in.

I see that there is nothing in the conf about lid-action on power....

wwalker@plutonium:~$ xfconf-query -c xfce4-power-manager -l -v
/xfce4-power-manager/brightness-level-on-ac             100
/xfce4-power-manager/brightness-level-on-battery        100
/xfce4-power-manager/brightness-switch                  0
/xfce4-power-manager/brightness-switch-restore-on-exit  0
/xfce4-power-manager/critical-power-action              1
/xfce4-power-manager/general-notification               true
/xfce4-power-manager/handle-brightness-keys             true
/xfce4-power-manager/hibernate-button-action            3
/xfce4-power-manager/inactivity-on-battery              60
/xfce4-power-manager/inactivity-sleep-mode-on-battery   1
/xfce4-power-manager/lid-action-on-battery              1
/xfce4-power-manager/logind-handle-lid-switch           true
/xfce4-power-manager/power-button-action                3
/xfce4-power-manager/show-tray-icon                     false
/xfce4-power-manager/sleep-button-action                3

This used to work.  so I could ssh in while it was in the dock but closed...

Should not matter but it is a ThinkPad W530
Comment 4 Wayne Walker 2019-09-25 20:08:13 CEST
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -s false

fixes it.

I would think change from a bug to a feature that shows something in the xfce4-power-manager to indicate that logind is handling the lid closure, and a check box to set logind-handle-lid-switch -s false
Comment 5 LIAR 2019-10-10 11:43:45 CEST
@Wayne Waker

Thanks, your command saved my day!!!

However, my initial problem was different :
- Dual monitors setup
- Lid closing was set to suspend
- Computer *did* suspend if 2nd monitor *was not* plugged in
- Computer *did not* suspend if 2nd monitor *was*  plugged in (quickly went to black screen, then woke up)

Your command:
xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -s false
solved the problem!!!!
Comment 6 Simon Steinbeiss editbugs 2019-10-10 13:30:10 CEST
We initially made this a hidden option because we felt distributors should set things up for their users in a sane way, because they also decide whether systemd is in use.
For power users or admins the hidden option should be enough.

We could maybe display an indicator for logind handling the lid, but this could also confuse "regular users" who have little or no idea what logind (or systemd) is.
Comment 7 Wayne Walker 2019-10-11 04:52:00 CEST
First, Thank you Simon for helping make xfce what it is. 

Second, I think we really need that message about lid closure handled by system, for the regular user rather than not having it for the regular user.

"regular users" should not be looking in the power manager lid control Unless something is already not working.  

If it isn't working for them, giving them a UI that looks like it should fix their problem, but doesn't will confuse and frustrate them far more than the confusion of "lid closure handled by systemd".  And then they could search the internet for "lid closure handled by systemd" and find this page and others.

Without the information that xfce power manager is Not handling the lid closure, even the power users (been on linux since '93 where I had to compile the kernel just to get my Yggdrasil CD to boot) like me are confused, and the regular user will be completely lost.
Comment 8 Remi 2020-01-07 06:35:47 CET
I have the same issue, here is an observation:

- If "Laptop Lid/On battery" is set to "Suspend", xfce4-power-manager sets logind-handle-lid-switch = true and "Laptop Lid/Plugged in" has no effect (bug)

- Similarly if "Laptop Lid/Plugged in" is set to "Suspend", xfce4-power-manager sets logind-handle-lid-switch = true and "Laptop Lid/On battery" has no effect (bug)

- If both "Laptop Lid/On battery" and "Laptop Lid/Plugged in" are set to "Suspend", xfce4-power-manager sets logind-handle-lid-switch = true (no bug)

- If both "Laptop Lid/On battery" and "Laptop Lid/Plugged in" are set to something other than "Suspend", xfce4-power-manager sets logind-handle-lid-switch = false (no bug)

The fix would be to let xfce4-power-manager set logind-handle-lid-switch = false as soon as either "Laptop Lid/On battery" OR "Laptop Lid/Plugged in" is set to something other than the default "Suspend" (and there won't be a need for an additional UI indicator)
Comment 9 Remi 2020-01-07 23:39:10 CET
Created attachment 9356 
Fix Laptop Lid settings when (lid_switch_on_ac != 1 || lid_switch_on_battery != 1)

LOGIND_HANDLE_LID_SWITCH should be set to False if either lid_switch_on_ac != 1 or lid_switch_on_battery != 1 (where 1 is 'Suspend' and the default logind behavior)

Fixes bugs #15300, #15151, #12756, #12088
Comment 10 mikemartino86@gmail.com 2020-05-04 17:03:18 CEST
Just in addition to the answers above, the setting didn't exist for me yet. I needed to create it.

sudo xfconf-query -c xfce4-power-manager -n -t 'bool' -p /xfce4-power-manager/logind-handle-lid-switch -s false

Then, it worked perfectly. Thanks very much for the answer folks.
Comment 11 idnsunset 2020-05-13 13:35:56 CEST
I am encountering the same issue with xfce4-power-manager 1.6.1, manually setting 'logind-handle-lid-switch' doesn't work. When either 'ON battery' or "Plugged in" is set to 'suspend', the system suspends anyway.

I personally think the fix posted by Remi above is correct. When either 'On battery' or 'Plugged in' is set to something other than 'suspend', it implies that the user wants xfce4-power-manager to take the place of logind to handle lid event, the 'logind-handle-lid-switch' should not be set to true. Could this fix be accepted by the developers?
Comment 12 Git Bot editbugs 2020-05-26 23:47:47 CEST
Remi Salmon referenced this bugreport in commit f89197509bb46e01817e130df2263bea26d2cca9

Fix Laptop lid settings (Bug #15300)

https://gitlab.xfce.org/xfce/xfce4-power-manager/commit/f89197509bb46e01817e130df2263bea26d2cca9
Comment 13 Simon Steinbeiss editbugs 2020-05-26 23:48:34 CEST
*** Bug 12088 has been marked as a duplicate of this bug. ***
Comment 14 Simon Steinbeiss editbugs 2020-05-26 23:49:54 CEST
@Remi: Thanks for the patch - pushed to Git master.

Sorry for the late response/review, I don't have much time for the power manager these days...
Comment 15 Simon Steinbeiss editbugs 2020-05-26 23:50:16 CEST
*** Bug 15151 has been marked as a duplicate of this bug. ***
Comment 16 Simon Steinbeiss editbugs 2020-05-26 23:50:31 CEST
*** Bug 12756 has been marked as a duplicate of this bug. ***
Comment 17 Simon Steinbeiss editbugs 2020-05-26 23:56:01 CEST
*** Bug 12728 has been marked as a duplicate of this bug. ***
Comment 18 Simon Steinbeiss editbugs 2020-05-27 00:36:54 CEST
*** Bug 13328 has been marked as a duplicate of this bug. ***
Comment 19 Simon Steinbeiss editbugs 2020-05-27 01:03:44 CEST
*** Bug 16797 has been marked as a duplicate of this bug. ***

Bug #15300

Reported by:
sca957
Reported on: 2019-04-18
Last modified on: 2020-05-27
Duplicates (6):
  • 12088 While light-locker security features are active, setting lid-close action to suspend for either power state forces it for both power states
  • 12728 laptop lid suspend does not work with light-locker "lock screen when system is going for sleep" enabled
  • 12756 Suspends on lid close on AC power even if set to lock screen
  • 13328 xfce4-power-manager doesn't suspend computer
  • 15151 Unable to override logind lid open/close handlers
  • 16797 power manager - laptop lid - on battery & plugged in

People

Assignee:
Sean Davis
CC List:
16 users

Version

Attachments

Additional information