! 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 !
Xfce4-power-manager does not catch lid events
Status:
RESOLVED: INVALID
Product:
Xfce4-power-manager
Component:
General

Comments

Description PF4Public 2017-08-02 20:49:41 CEST
Xfce4-power-manager does not catch lid events.
acpi_listen does show lid events.
UPower does catch lid events.
Xfce4-power-manager --debug gives no output on lid events.
It has settings for lid events, but they are ignored as no event catched.
It does appropriate actions upon suspend and poweroff keys, but not lid.
What is wrong here?
Thanks in advance.
Comment 1 Simon Naunton 2017-08-10 13:44:58 CEST
Have you tried:

xfconf-query -c xfce4-power-manager -p /xfce4-power-manager/logind-handle-lid-switch -n -t bool -s false
Comment 2 PF4Public 2017-08-10 19:05:25 CEST
Of course! But this does not help.
Since my system does not even have logind, this might be irrelevant setting though.
But anyway thanks for your answer!
Comment 3 Ali Abdallah editbugs 2017-11-15 15:40:59 CET
Try to monitor the bus to see if upower is effectively sending the signal to the power manager, using the following command. 

dbus-monitor --system "type='signal',sender='org.freedesktop.UPower'"
Comment 4 PF4Public 2017-11-15 20:29:02 CET
Thanks for your reply.
Activating and deactivating lid button gives me these events:
signal time=1510773931.714558 sender=:1.20 -> destination=(null destination) serial=3144 path=/org/freedesktop/UPower; interface=org.freedesktop.UPower; member=Changed
signal time=1510773932.546623 sender=:1.20 -> destination=(null destination) serial=3145 path=/org/freedesktop/UPower; interface=org.freedesktop.UPower; member=Changed
One for lid-close event, the other for lid-open respectively with ever increasing serial.
Is there anything else I can do to identify the cause of this issue?
Comment 5 Pavel Nikulin 2018-07-18 15:45:37 CEST
I'm also having this issue.

Upower does register LID events

signal time=1531921145.698725 sender=:1.10 -> destination=(null destination) serial=748 path=/org/freedesktop/UPower; interface=org.freedesktop.UPower; member=Changed

But I have nothing in xfpm debug output

To my memory, suspend by lid worked few times for me.
Comment 6 Pavel Nikulin 2018-07-18 15:46:25 CEST
My system.

Gentoo
Elogind
upower-pm-utils
No systemd
Comment 7 Pavel Nikulin 2018-07-18 16:11:02 CEST
Debug output https://pastebin.com/bsn97Vwq

baybal@xps ~ $ xfconf-query -c xfce4-power-manager -vl
/xfce4-power-manager/blank-on-battery                   2
/xfce4-power-manager/brightness-on-battery              60
/xfce4-power-manager/brightness-switch                  0
/xfce4-power-manager/brightness-switch-restore-on-exit  0
/xfce4-power-manager/general-notification               true
/xfce4-power-manager/handle-brightness-keys             true
/xfce4-power-manager/hibernate-button-action            2
/xfce4-power-manager/inactivity-on-battery              176
/xfce4-power-manager/inactivity-sleep-mode-on-battery   1
/xfce4-power-manager/lid-action-on-ac                   0
/xfce4-power-manager/lid-action-on-battery              1
/xfce4-power-manager/lock-screen-suspend-hibernate      false
/xfce4-power-manager/logind-handle-lid-switch           false
/xfce4-power-manager/power-button-action                1
/xfce4-power-manager/presentation-mode                  false
/xfce4-power-manager/show-panel-label                   3
/xfce4-power-manager/show-tray-icon                     true
/xfce4-power-manager/sleep-button-action                1

baybal@xps ~ $ xfce4-power-manager --dump
---------------------------------------------------
       Xfce power manager version 1.6.1
With policykit support
Without network manager support
---------------------------------------------------
Can suspend: True
Can hibernate: True
Authorised to suspend: True
Authorised to hibernate: True
Authorised to shutdown: True
Has battery: True
Has brightness panel: True
Has power button: True
Has hibernate button: True
Has sleep button: True
Has LID: True
Comment 8 Pavel Nikulin 2018-07-18 16:19:37 CEST
sys-power/upower-pm-utils 0.9.23-r2

xfce 4.12 

polkit 0.113

pm-utils 1.4.1
Comment 9 Chris Rainey 2018-07-27 17:20:28 CEST
I solved this yesterday on Ubuntu 18.04.1:


Using a pure install of the "xfce4" and "xfce4-power-manager" packages after a clean install of Ubuntu 18.04 LTS does not lock the screen when closing a laptop lid without manually adding the following property to the local or global xfconf database(/etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-session.xml):

<property name="LockCommand" type="string" value="xscreensaver-command -lock"/>

This property is undiscoverable and not well documented, if at all.

There was a patch to add this property back in 2015 @ https://git.xfce.org/xfce/xfce4-session/commit/settings/xfce4-session.xml?id=570093ffafa8a6226ce9dd0ee29e9e64539d4bc9, but it does not appear to be in the current Ubuntu source.

Manually adding this prpoerty is accomplished by the following command:

$xfconf-query -c xfce4-session -p /general/LockCommand -s 'xscreensaver-command -lock' -v -n -t string

Without this parameter and a named running screen locking daemon(XScreenSaver by default), the system will Suspend---but, not be locked upon Resume when triggered by a laptop lid-switch.

Please add or patch the Ubuntu version to provide this basic functionality as "systemd-logind.service" is not overriding by default:

$ systemd-inhibit --list
     Who: NetworkManager (UID 0/root, PID 936/NetworkManager)
    What: sleep
     Why: NetworkManager needs to turn off networks
    Mode: delay

     Who: ModemManager (UID 0/root, PID 895/ModemManager)
    What: sleep
     Why: ModemManager needs to reset devices
    Mode: delay

     Who: UPower (UID 0/root, PID 1564/upowerd)
    What: sleep
     Why: Pause device polling
    Mode: delay

     Who: xfce4-power-manager (UID 1000/chris, PID 1614/xfce4-power-man)
    What: handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
     Why: xfce4-power-manager handles these events
    Mode: block

4 inhibitors listed.



https://bugs.launchpad.net/ubuntu/+source/xfce4-session/+bug/1783895
Comment 10 Pavel Nikulin 2018-07-31 13:51:33 CEST
Installing latest upower solved my issues.

It appears that upower-pm-utils form of 0.9 does not have the new lid events api.
Comment 11 Simon Steinbeiss editbugs 2020-05-27 01:05:20 CEST
(In reply to Pavel Nikulin from comment #10)
> Installing latest upower solved my issues.
> 
> It appears that upower-pm-utils form of 0.9 does not have the new lid events
> api.

Thanks for reporting back!

Bug #13761

Reported by:
PF4Public
Reported on: 2017-08-02
Last modified on: 2020-05-27

People

Assignee:
Ali Abdallah
CC List:
7 users

Version

Attachments

Additional information