[gnome-settings-daemon] automount: don't queue volumes when the session is inactive



commit 6ead77f1d7140691bb6b0658c53e2579016da63d
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Mar 7 00:35:21 2011 -0500

    automount: don't queue volumes when the session is inactive
    
    https://bugzilla.gnome.org/show_bug.cgi?id=644087

 plugins/automount/gsd-automount-manager.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/plugins/automount/gsd-automount-manager.c b/plugins/automount/gsd-automount-manager.c
index 5988f2b..7e28768 100644
--- a/plugins/automount/gsd-automount-manager.c
+++ b/plugins/automount/gsd-automount-manager.c
@@ -207,6 +207,10 @@ static void
 check_screen_lock_and_mount (GsdAutomountManager *manager,
                              GVolume *volume)
 {
+        if (!manager->priv->session_is_active) {
+                return;
+        }
+
         if (manager->priv->screensaver_active) {
                 /* queue the volume, to mount it after the screensaver state changed */
                 g_debug ("Queuing volume %p", volume);
@@ -308,6 +312,13 @@ ck_session_proxy_signal_cb (GDBusProxy *proxy,
 	if (g_strcmp0 (signal_name, "ActiveChanged") == 0) {
 		g_variant_get (parameters, "(b)", &p->session_is_active);
 		g_debug ("ConsoleKit session is active %d", p->session_is_active);
+
+                if (!p->session_is_active) {
+                        if (manager->priv->volume_queue != NULL) {
+                                g_list_free_full (manager->priv->volume_queue, g_object_unref);
+                                manager->priv->volume_queue = NULL;
+                        }
+                }
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]