Laptop lid setting on AC ignored
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Xfce4 Power Manager |
Confirmed
|
Medium
|
|||
xfce4-power-manager (Ubuntu) |
Confirmed
|
Medium
|
Unassigned | ||
Focal |
New
|
Undecided
|
Unassigned | ||
Impish |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
In XFCE's power management settings, there are two options for what to do when you close the lid of the laptop. On battery, and for when on AC power.
Problem is, while on AC, it's still using the "on battery" setting, and never actually uses the on AC power setting. For example, my settings are as follows:
On Battery: Suspend
On AC Power: Switch off display
When I close the laptop while plugged into the charger, it still goes to sleep and suspends. If I however change the on battery status to Switch off display, then closing the lid does just that, doesn't suspend, and stays on with the display switched off, despite it being plugged into the power cord.
I have verified that Xfce knows the charger is plugged in as the battery icon shows the lightning bolt when it should.
ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: xfce4-power-manager 1.4.3-0ubuntu1
ProcVersionSign
Uname: Linux 3.19.0-21-generic x86_64
ApportVersion: 2.17.2-0ubuntu1.1
Architecture: amd64
CurrentDesktop: XFCE
Date: Mon Jul 6 16:57:10 2015
InstallationDate: Installed on 2015-07-05 (1 days ago)
InstallationMedia: Xubuntu 15.04 "Vivid Vervet" - Release amd64 (20150422.1)
SourcePackage: xfce4-power-manager
UpgradeStatus: No upgrade log present (probably fresh install)
Changed in xfce4-power-manager: | |
importance: | Unknown → Medium |
status: | Unknown → Confirmed |
Changed in xfce4-power-manager (Ubuntu): | |
importance: | Undecided → Medium |
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: handle- lid-switch = true when: lock_on_suspend == true and (lid_switch_on_ac == suspend or lid_switch_ on_battery == suspend)"
The cause is clear in the xfce4-power-manager code. In xfpm-settings.c there is a comment stating the following:
"logind-
...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: on_battery == suspend)"
"(lid_switch_on_ac == suspend or lid_switch_
[1] http:// git.xfce. org/xfce/ xfce4-power- manager/ tree/settings/ xfpm-settings. c#n812 /mail.xfce. org/pipermail/ xfce4-dev/ 2015-July/ 031347. html /forum. manjaro. org/index. php?topic= 7319.msg210748# msg210748
[2] https:/
[3] https:/