[rhythmbox] status-icon: only restore visibility from gconf when autostarted (bug #537868)



commit 6c704ee04b3fa8c9c79e73e8c6429605ebd33c27
Author: Jonathan Matthew <jonathan d14n org>
Date:   Thu Jun 24 16:28:10 2010 +1000

    status-icon: only restore visibility from gconf when autostarted (bug #537868)
    
    When explicitly started by the user, we should always show the main window so
    the user isn't left wondering what happened.

 plugins/status-icon/rb-status-icon-plugin.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/plugins/status-icon/rb-status-icon-plugin.c b/plugins/status-icon/rb-status-icon-plugin.c
index 5035d94..e949040 100644
--- a/plugins/status-icon/rb-status-icon-plugin.c
+++ b/plugins/status-icon/rb-status-icon-plugin.c
@@ -1000,7 +1000,6 @@ visibility_changing_cb (RBShell *shell,
 			gboolean visible,
 			RBStatusIconPlugin *plugin)
 {
-
 	switch (plugin->priv->icon_mode) {
 	case ICON_NEVER:
 	case ICON_WITH_NOTIFY:
@@ -1016,9 +1015,16 @@ visibility_changing_cb (RBShell *shell,
 	}
 
 	if (initial) {
-		/* restore visibility from gconf setting */
-		visible = eel_gconf_get_boolean (CONF_WINDOW_VISIBILITY) || eel_gconf_is_default (CONF_WINDOW_VISIBILITY);
-		rb_debug ("setting initial visibility %d from gconf", visible);
+		gboolean autostarted;
+		g_object_get (shell, "autostarted", &autostarted, NULL);
+		if (autostarted) {
+			/* restore visibility from gconf setting */
+			visible = eel_gconf_get_boolean (CONF_WINDOW_VISIBILITY) || eel_gconf_is_default (CONF_WINDOW_VISIBILITY);
+			rb_debug ("setting initial visibility %d from gconf", visible);
+		} else {
+			rb_debug ("ignoring stored visibility as we weren't autostarted");
+			visible = TRUE;
+		}
 		return visible;
 	}
 



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