]> granicus.if.org Git - transmission/commitdiff
(gtk) #1073: Too many queries to disable Desktop hibernation
authorCharles Kerr <charles@transmissionbt.com>
Sun, 6 Jul 2008 00:56:19 +0000 (00:56 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Sun, 6 Jul 2008 00:56:19 +0000 (00:56 +0000)
gtk/tr-core.c

index 7b76c6735d88f477a4506c1edef667bef3878451..a748331030c01671836653a0a1f640c215f46b69 100644 (file)
@@ -60,6 +60,7 @@ struct TrCorePrivate
 #endif
     gboolean           inhibit_allowed;
     gboolean           have_inhibit_cookie;
+    gboolean           dbus_error;
     guint              inhibit_cookie;
     GtkTreeModel     * model;
     tr_handle        * handle;
@@ -1011,9 +1012,14 @@ tr_core_set_hibernation_allowed( TrCore * core, gboolean allowed )
         core->priv->have_inhibit_cookie = FALSE;
     }
 
-    if( !allowed && !core->priv->have_inhibit_cookie )
+    if( !allowed &&
+        !core->priv->have_inhibit_cookie &&
+        !core->priv->dbus_error )
     {
-        core->priv->have_inhibit_cookie = gtr_inhibit_hibernation( &core->priv->inhibit_cookie );
+        if( gtr_inhibit_hibernation( &core->priv->inhibit_cookie ) )
+            core->priv->have_inhibit_cookie = TRUE;
+        else
+            core->priv->dbus_error = TRUE;
     }
 #endif
 }