gsd-power inhibiting lid close
Hi,
My laptop (ThinkPad P1) is not suspending on lid close. Upon checking, it appears that gsd-power thinks I am connected to multiple displays. The output of xrandr is
Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-2 connected primary 3840x2160+0+0 (normal left inverted right x axis y axis) 344mm x 193mm
3840x2160 60.00*+
These are the output of $ systemd-inhibit
NetworkManager 0 root 499 NetworkManager sleep NetworkManager needs to turn off networks delay
UPower 0 root 737 upowerd sleep Pause device polling delay
gdm 120 gdm 753 gsd-power handle-lid-switch Multiple displays attached block
gdm 120 gdm 749 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
gdm 120 gdm 749 gsd-media-keys sleep GNOME handling keypresses delay
gdm 120 gdm 753 gsd-power sleep GNOME needs to lock the screen delay
GNOME Shell 1000 phycent 1061 gnome-shell sleep GNOME needs to lock the screen delay
Telepathy 1000 phycent 1158 mission-control shutdown:sleep Disconnecting IM accounts before suspend/shutdown... delay
phycent 1000 phycent 1202 gsd-power handle-lid-switch Multiple displays attached block
phycent 1000 phycent 1239 gsd-media-keys handle-power-key:handle-suspend-key:handle-hibernate-key GNOME handling keypresses block
phycent 1000 phycent 1239 gsd-media-keys sleep GNOME handling keypresses delay
phycent 1000 phycent 1202 gsd-power sleep GNOME needs to lock the screen delay
The laptop notices the lid movement. Setting systemd.log_level=debug in the kernel and doing
$ sudo journalctl --unit=systemd-logind --follow
gives:
Feb 23 09:49:38 phycent-p1 systemd-logind[513]: Lid closed.
Feb 23 09:49:38 phycent-p1 systemd-logind[513]: Refusing operation, handle-lid-switch is inhibited.
..... the above line repeats until the lid is re-opened ...
Feb 23 09:49:48 phycent-p1 systemd-logind[513]: Lid opened.
The laptop can suspend by ignoring inhibitors. But options in /etc/systemd/logind.conf do not disrespect the "block-ing" inhibitors. Options tried includes (although these are the default values):
HandleLidSwitch=suspend
LidSwitchIgnoreInhibited=yes
I am not connected to multiple displays. I simply want my gnome to lock and suspend on lid-close.
Edited by Ghost User