screensaver-proxy: Check gnome-session Inhibit call return value
Submitted by 288..@..ix.org
Link to original bug (#784350)
Description
gsd-screensaver-proxy proxies inhibition to gnome-session. But if the Inhibit call to gnome-session fails, gsd-screensaver-proxy will not return anything and the dbus call will time out. Try for example with empty reason:
$ dbus-send --session --dest=org.freedesktop.ScreenSaver --print-reply /org/freedesktop/ScreenSaver org.freedesktop.ScreenSaver.Inhibit string:'test' string:''
Error org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
Log says:
Jun 29 17:31:53 hiraizumi gnome-session[631]: gnome-session-binary[631]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Jun 29 17:31:53 hiraizumi gnome-session-binary[631]: GLib-GObject-CRITICAL: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Jun 29 17:31:53 hiraizumi gsd-screensaver[890]: g_variant_get_va: assertion 'value != NULL' failed
Jun 29 17:31:53 hiraizumi gsd-screensaver[890]: Type of return value is incorrect: expected '(u)', got '()''
gnome-session correctly gives error:
$ dbus-send --session --dest=org.gnome.SessionManager --print-reply /org/gnome/SessionManager org.gnome.SessionManager.Inhibit string:'test' uint32:0 string:'' uint32:4
Error org.gnome.SessionManager.GeneralError: Reason not specified
Edited by Benjamin Berg