Suspend on lid close can not be configured individually for battery/AC

Bug #1623385 reported by b3nmore
This bug report is a duplicate of:  Bug #1471979: Laptop lid setting on AC ignored. Edit Remove
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
xfce4-power-manager (Ubuntu)
New
Undecided
Unassigned

Bug Description

Xfce power-manager allows to configure individual actions for the lid close event for battery and AC mode. However, if one is set to suspend the system suspends always despite it might be configured otherwise for the current state.

I believe this happens because xfpm unconditionally removes the handle-lid-switch inhibitor. Instead xfpm should check the power mode (battery/AC) and only remove the inhibitor if it is actually configured to do so for the current power mode. Of course this check must be repeated on every change of the power mode.

Test case:
On eg. AC mode set the lid close action for battery mode to suspend and for AC mode to eg. lock screen.
systemd-inhibit --list shows that the handle-lid-switch inhibitor is removed.
Closing the lid in AC mode consequently lets logind handle the event, which defaults to suspend.

I get this on all up-to-date xubuntu 16.04 installations.

Tags: xenial yakkety
Revision history for this message
b3nmore (b3nmore) wrote :

This also happens on yakkety (well, its same version).

In both cases it requires the 'Lock screen when system is going to sleep' option to be set.

tags: added: xenial yakkety
Revision history for this message
b3nmore (b3nmore) wrote :

As suspected its caused by the light-locker integration. More specifically by xfpm_update_logind_handle_lid_switch in xfpm-settings.c:

logind-handle-lid-switch = true when: lock_on_suspend == true and (lid_switch_on_ac == suspend or lid_switch_on_battery == suspend)

Revision history for this message
b3nmore (b3nmore) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.