+ /* clear the cookie */
+ scr->priv->cookie = 0;
+ g_variant_unref (value);
+}
+
+static void
+screensaver_inhibit_dbus (TotemScrsaver *scr,
+ gboolean inhibit)
+{
+ TotemScrsaverPrivate *priv = scr->priv;
+
+ if (!priv->have_screensaver_dbus)
+ return;
+
+ scr->priv->old_dbus_api = FALSE;
+
+ if (inhibit) {
+ g_return_if_fail (scr->priv->reason != NULL);
+ g_dbus_proxy_call (priv->gs_proxy,
+ "Inhibit",
+ g_variant_new ("(ss)",
+ g_get_application_name (),
+ scr->priv->reason),
+ G_DBUS_CALL_FLAGS_NO_AUTO_START,
+ -1,
+ NULL,
+ on_inhibit_cb,
+ scr);
+ } else {
+ g_dbus_proxy_call (priv->gs_proxy,
+ "UnInhibit",
+ g_variant_new ("(u)", priv->cookie),
+ G_DBUS_CALL_FLAGS_NO_AUTO_START,
+ -1,
+ NULL,
+ on_uninhibit_cb,
+ scr);