! 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 !
While light-locker security features are active, setting lid-close action to ...
Status:
RESOLVED: DUPLICATE
Product:
Xfce4-power-manager
Component:
General

Comments

Description Rob McCathie 2015-07-24 13:14:48 CEST
Tested on Arch Linux, Manjaro Linux.


Prerequisites to replicate:

Be on a laptop with a lid switch. Ensure lightdm and light-locker are installed, working and the light-locker daemon is running, thus activating xfce4-power-manager's light-locker integration (i.e. the 'Security' tab in xfce4-power-manager's settings window).


To replicate:

In the xfce4-power-manager settings, ensure "Lock screen when system is going for sleep" in the Security tab is enabled (which can activate this logind-handle-lid-switch "feature" dependant on other factors described below).

In the General tab set the "Laptop Lid" action for "On battery" to "Suspend" and the action for "Plugged in" to anything other than Suspend (eg. "Switch off display").

While the laptop is plugged in, close the lid. It should not suspend because we set the action for plugged in to be something other than suspend, but it DOES suspend.

i.e. If *either* "On battery" or "Plugged in" is set to suspend, the action taken for both power states is always suspend, even if one of them is set to something else.


Cause:
The cause is clear in the xfce4-power-manager code. In xfpm-settings.c there is a comment stating the following:
"logind-handle-lid-switch = true when: lock_on_suspend == true and (lid_switch_on_ac == suspend or lid_switch_on_battery == suspend)"
...and the following line of code does this.

At the time of this bug report it is at line 812 of xfpm-settings.c[1]

Since i don't understand why handling off to logind is occurring at all (despite asking why multiple times on the xfce4-dev mailing list[2]), my suggestion is to stop handing off to logind, especially since until very recently (i'm fairly sure it's since the systemd 222 update) systemd/logind wouldn't even suspend my netbook properly anyway, but xfce4-power-manager (when not handing off to logind) did suspend the system just fine. Another user confirmed the same behaviour on different brand of hardware too.[3]

At the least, i'd think it should be changed to be AND rather than OR in regards to:
"(lid_switch_on_ac == suspend or lid_switch_on_battery == suspend)"


[1] http://git.xfce.org/xfce/xfce4-power-manager/tree/settings/xfpm-settings.c#n812
[2] https://mail.xfce.org/pipermail/xfce4-dev/2015-July/031347.html
[3] https://forum.manjaro.org/index.php?topic=7319.msg210748#msg210748
Comment 1 Octavio Alvarez 2015-08-02 16:28:06 CEST
I'm bit by this too. I'm not using light-locker, only lightdm. The problem occurs regardless of the "Lock screen when system is going for sleep" setting.
Comment 2 Christopher Robert Philabaum 2015-09-14 02:00:10 CEST
Also confirmed on Xubuntu 14.04+ https://bugs.launchpad.net/ubuntu/+source/xfce4-power-manager/+bug/1471979.
Comment 3 Christopher Robert Philabaum 2015-09-14 02:06:24 CEST
Excuse me, Xubuntu 15.04+.
Comment 4 Javier Fernández 2015-10-12 14:14:35 CEST
Yes, similar confirmed on Arch also. 

Besides, I can't get be lock the session, if i choose this for lid switch actions. Only i can use "switch off display", "suspend" and "hibernate" options but doesn't work "lock screen". At least there is a strange behavior.

My package is xfce4-power-manager-devel 1.5.2 from AUR

Thank so much! :D
Comment 5 Javier Fernández 2015-10-12 16:58:42 CEST
(In reply to Javier Fernández from comment #4)
> Yes, similar confirmed on Arch also. 
> 
> Besides, I can't get be lock the session, if i choose this for lid switch
> actions. Only i can use "switch off display", "suspend" and "hibernate"
> options but doesn't work "lock screen". At least there is a strange behavior.
> 
> My package is xfce4-power-manager-devel 1.5.2 from AUR
> 
> Thank so much! :D

Indeed, i think light-locker should be better integrated into xfce4-power-manager, there are many features implied to locking screen that xfce4-power-manager doesn't control appropriately. But again thank for ur work ;)
Comment 6 Junaid Ahmed 2018-04-30 21:40:10 CEST
Bug is present on Xubuntu 18.04(xfce4-power-manager 1.6.1)
Comment 7 Simon Steinbeiss editbugs 2020-05-26 23:48:34 CEST

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

Bug #12088

Reported by:
Rob McCathie
Reported on: 2015-07-24
Last modified on: 2020-05-26

People

Assignee:
Ali Abdallah
CC List:
9 users

Version

Attachments

Additional information