[xfce4-power-manager] Locking on sleep breaks laptop lid actions

Rob McCathie rob at manjaro.org
Mon Jul 20 10:25:45 CEST 2015


On 07/06/15 02:58, Rob McCathie wrote:
> On 07/06/15 01:57, Rob McCathie wrote:
>> Hi Xfce-dev list,
>>
>> Currently for me on my Netbook, running Manjaro, enabling the "Lock 
>> screen when system is going for sleep" option (in the Security tab of 
>> Power Manager's settings) breaks the PM's ability to manage what 
>> happens when the laptop lid is closed.
>>
>> I've narrowed this down to the "Lock screen when system is going for 
>> sleep" option enabling the following xfconf setting:
>> xfce4-power-manager/logind-handle-lid-switch
>>
>> If i disable this setting myself manually (but leaving the other 
>> changes the lock at sleep option modifies) everything works as expected.
>>
>> Do you need this option to be enabling that xfconf setting? If so, i 
>> suppose we'll have to patch xfce4-power-manager for Manjaro...
>>
>
> Just had a look at the code and realised it's only when the laptop lid 
> close action (in the General tab) has *either* on-battery or 
> plugged-in action set to Suspend that the logind handling gets enabled.
>
> I've just done some more testing and HandleLidSwitch= setting in 
> /etc/systemd/logind.conf doesn't seem to be having effect for me, but 
> everything else does... maybe this is specific to my hardware... 
> strange though that the power manager handles my lid switch fine... i 
> guess xfpm>systemd? :D
> Nonetheless, what is the reason for handing off to logind anyways?

Ok so, one other user with different brand of hardware did actually 
confirm they experience the same issue[1], however some very recent 
update (to systemd i assume) has resolved logind/systemd's ability to 
suspend my system. So now setting the laptop lid actions to Suspend in 
xfpm's settings does result in the system suspending when i close the lid...
However, there's still the issue that i mentioned before:

 >Just had a look at the code and realised it's only when the laptop lid 
close action (in the General tab) has *either* on-battery or plugged-in 
action set to Suspend that the logind handling gets enabled.
[2]

The result of this is that if i set the laptop lid action for "On 
battery" to Hibernate and the action for "Plugged in" to Suspend, when i 
close the lid while on battery the system suspends, not hibernates.

One solution would be that handing off to logind only occurs if *both* 
"On battery" *and* "Plugged in" are set to Suspend (rather than "On 
battery" *or* "Plugged in" being set to Suspend making it occur), but I 
still don't get why in *any* event actions get handed off to logind. 
Everything works great if they don't.


[1] https://forum.manjaro.org/index.php?topic=7319.msg210748#msg210748
[2] 
http://git.xfce.org/xfce/xfce4-power-manager/tree/settings/xfpm-settings.c#n812

--
Regards,

Rob McCathie
Manjaro Team



More information about the Xfce4-dev mailing list