Power Manager handling unassigned/unused buttons, causing systemd logind to fail to handle them
Submitted by Mark Smith
Description
Similar to https://bugzilla.xfce.org/show_bug.cgi?id=11339, I wanted my system to do a hybrid suspend/hibernate.
However, I instead attempted to use 'systemd-logind(8)', by assigning a 'hybrid-sleep' action to the 'HandlePowerKey' event, and making logind ignore inhibit locks on the Power key. Doing it with logind made a bit more sense to me, as it would be independent of the DE environment operating or not.
[mark@opy systemd]$ sudo grep -v "^#" logind.conf
[Login]
HandlePowerKey=hybrid-sleep
PowerKeyIgnoreInhibited=yes
[mark@opy systemd]$
On my laptops, this seemed to work for a while, however on my desktop, which is the system I most want to use it, it didn't. logind was reporting in the system log that it was receiving a PowerKey event, but wasn't doing anything with it.
I thought this may have been a bug with logind, as the description option of PowerKeyIgnoreInhibited=yes sounded like logind should perform actions for these events regardless of if other applications were handling the power button.
I lodged a bug a while back about it:
https://bugzilla.redhat.com/show_bug.cgi?id=1194951
Lennart Pottering himself got back to me today, and suggested that the DE might be handling the PowerKey, and suggested running the 'systemd-inhibit --list' command. This showed that Xfce4-power-manager was handling the power, hibernate and sleep buttons. This was despite there being no actions attached to those buttons. This seemed to explain why my logind configuration was not working.
While there may be a bug with logind's handling of PowerKeyIgnoreInhibited=yes, I think xfce4-power-manager handling buttons that don't have any actions assigned made this issue a bit harder for me to troubleshoot - perhaps on my laptops I had also assigned the 'suspend' action to their power buttons, which made me think this problem was isolated to my desktop.
So I think it would be better if xfce4-power-manager only handled buttons for which an action has been assigned, which would allow logind to process buttons without xfc4-power-manager actions.
Thanks, Mark.
Version: 1.4.x