+ value = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!value) {
+ g_warning ("Problem inhibiting the screensaver: %s", error->message);
+ g_object_unref (scr);
+ g_error_free (error);
+
+ return;
+ }
+
+ /* save the cookie */
+ if (g_variant_is_of_type (value, G_VARIANT_TYPE ("(u)")))
+ g_variant_get (value, "(u)", &scr->priv->cookie);
+ else
+ scr->priv->cookie = 0;
+ g_variant_unref (value);
+
+ g_object_unref (scr);
+}
+
+static void
+on_uninhibit_cb (GObject *source_object,
+ GAsyncResult *res,
+ gpointer user_data)
+{
+ GDBusProxy *proxy = G_DBUS_PROXY (source_object);
+ TotemScrsaver *scr = TOTEM_SCRSAVER (user_data);
+ GVariant *value;
+ GError *error = NULL;
+
+ value = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (!value) {
+ g_warning ("Problem uninhibiting the screensaver: %s", error->message);
+ g_object_unref (scr);
+ g_error_free (error);
+
+ return;
+ }
+
+ /* clear the cookie */
+ scr->priv->cookie = 0;
+ g_variant_unref (value);
+
+ g_object_unref (scr);