screensaver proxy uninhibits right after setting up an inhibitor
Running this command to inhibit the screensaver:
dbus-send --session --dest=org.freedesktop.ScreenSaver --type=method_call --print-reply --reply-timeout=20000 /org/freedesktop/ScreenSaver org.freedesktop.ScreenSaver.Inhibit string:"gnome-shell" string:"test"
method return time=1526632096.625561 sender=:1.42 -> destination=:1.138 serial=26 reply_serial=2
uint32 1844134301
screensaver-proxy of gnome-settings-daemon sets up an idle inhibitor as expected. However it removes the inhibitor immediately after, on its own if I understand correctly. From gnome-session debug:
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmManager: Inhibit xid=0 app_id=gnome-shell reason=test flags=8
gnome-session-binary[3329]: DEBUG(+): GsmManager: Inhibit xid=0 app_id=gnome-shell reason=test flags=8
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmInhibitor: setting client-id =
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmStore: Adding object id /org/gnome
/SessionManager/Inhibitor2 to store
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmManager: Inhibitor added: /org/gnome/SessionManager/Inhibitor2
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmPresence: removing idle watch (2)
gnome-session-binary[3329]: DEBUG(+): GsmInhibitor: setting client-id =
gnome-session-binary[3329]: DEBUG(+): GsmStore: Adding object id /org/gnome/SessionManager/Inhibitor2 to store
gnome-session-binary[3329]: DEBUG(+): GsmManager: Inhibitor added: /org/gnome/SessionManager/Inhibitor2
gnome-session-binary[3329]: DEBUG(+): GsmPresence: removing idle watch (2)
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmManager: Uninhibit 1844134301
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmManager: removing inhibitor gnome-shell 0 reason 'test' 8 connection :1.42
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmStore: Unreffing object: 0x7f804c00f500
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmManager: Inhibitor removed: /org/gnome/SessionManager/Inhibitor2
gnome-session-binary[3329]: DEBUG(+): GsmManager: Uninhibit 1844134301
/usr/lib/gdm/gdm-wayland-session[3325]: gnome-session-binary[3329]: DEBUG(+): GsmPresence: adding idle watch (4) for 60 secs
gnome-session-binary[3329]: DEBUG(+): GsmManager: removing inhibitor gnome-shell 0 reason 'test' 8 connection :1.42
gnome-session-binary[3329]: DEBUG(+): GsmStore: Unreffing object: 0x7f804c00f500
gnome-session-binary[3329]: DEBUG(+): GsmManager: Inhibitor removed: /org/gnome/SessionManager/Inhibitor2
Is this expected behavior? Is the logic in plugins/screensaver-proxy/gsd-screensaver-proxy-manager.c name_vanished_cb() correct?
Commenting out the uninhibit call in name_vanished_cb() has the desired effect of keeping the inhibitor in place.
Then the inhibitor can be manually removed whenver needed, using the cookie returned in the first call:
dbus-send --session --dest=org.freedesktop.ScreenSaver --type=method_call --print-reply --reply-timeout=20000 /org/freedesktop/ScreenSaver org.freedesktop.ScreenSaver.UnInhibit uint32:1844134301
Using gnome-settings-daemon-3.28.1
Edited by Vasilis Liaskovitis