diff -ru rhythmbox/data/ui/rhythmbox-ui.xml rhythmbox/data/ui/rhythmbox-ui.xml
--- rhythmbox/data/ui/rhythmbox-ui.xml	2003-08-31 14:17:01.000000000 -0400
+++ rhythmbox/data/ui/rhythmbox-ui.xml	2003-08-31 14:08:49.000000000 -0400
@@ -133,7 +133,8 @@
 	 type="toggle"/>
     
     <cmd name="ShowWindow"
-	 _tip="Change the visibility of the main window"/>
+	 _tip="Change the visibility of the main window"
+	 type="toggle"/>
     
     <cmd name="SongInfo"
 	 pixtype="stock"
diff -ru rhythmbox/data/ui/rhythmbox-ui.xml.in rhythmbox/data/ui/rhythmbox-ui.xml.in
--- rhythmbox/data/ui/rhythmbox-ui.xml.in	2003-08-31 14:16:32.000000000 -0400
+++ rhythmbox/data/ui/rhythmbox-ui.xml.in	2003-08-31 14:18:08.000000000 -0400
@@ -133,7 +133,8 @@
 	 type="toggle"/>
     
     <cmd name="ShowWindow"
-	 _tip="Change the visibility of the main window"/>
+	 _tip="Change the visibility of the main window"
+	 toggle="true"/>
     
     <cmd name="SongInfo"
 	 pixtype="stock"
diff -ru rhythmbox/shell/rb-tray-icon.c rhythmbox/shell/rb-tray-icon.c
--- rhythmbox/shell/rb-tray-icon.c	2003-08-31 14:17:01.000000000 -0400
+++ rhythmbox/shell/rb-tray-icon.c	2003-08-31 14:09:17.000000000 -0400
@@ -54,12 +54,15 @@
 					  guint prop_id,
 					  GValue *value,
 					  GParamSpec *pspec);
+static void rb_tray_set_visibility (RBTrayIcon *tray, int state);
 static void rb_tray_icon_button_press_event_cb (GtkWidget *ebox, GdkEventButton *event,
 						RBTrayIcon *icon);
-static void sync_menu (RBTrayIcon *tray, guint button);
-static void rb_tray_icon_cmd_show_window (BonoboUIComponent *component,
-					  RBTrayIcon *shell,
-					  const char *verbname);
+static void sync_menu (RBTrayIcon *tray);
+static void rb_tray_icon_show_window_changed_cb (BonoboUIComponent *component,
+					const char *path,
+					Bonobo_UIComponent_EventType type,
+					const char *state,
+					RBTrayIcon *icon);
 static void rb_tray_icon_drop_cb (GtkWidget *widget,
 				  GdkDragContext *context,
 				  gint x,
@@ -69,6 +72,8 @@
 				  guint time,
 				  RBTrayIcon *icon);
 
+#define CMD_PATH_SHOW_WINDOW    "/commands/ShowWindow"
+
 struct RBTrayIconPrivate
 {
 	GtkTooltips *tooltips;
@@ -97,13 +102,21 @@
 
 enum
 {
+	VISIBILITY_HIDDEN,
+	VISIBILITY_VISIBLE,
+	VISIBILITY_SYNC,
+	VISIBILITY_TOGGLE
+};
+
+enum
+{
 	LAST_SIGNAL,
 };
 
-static BonoboUIVerb rb_tray_icon_verbs[] =
+static RBBonoboUIListener rb_tray_icon_listeners[] =
 {
-	BONOBO_UI_VERB ("ShowWindow", (BonoboUIVerbFn) rb_tray_icon_cmd_show_window),
-	BONOBO_UI_VERB_END
+	RB_BONOBO_UI_LISTENER ("ShowWindow", (BonoboUIListenerFn) rb_tray_icon_show_window_changed_cb),
+	RB_BONOBO_UI_LISTENER_END
 };
 
 static const GtkTargetEntry target_uri [] =
@@ -223,9 +236,9 @@
 	icon->priv->control = bonobo_control_new (icon->priv->ebox);
 	icon->priv->tray_component = bonobo_control_get_popup_ui_component (icon->priv->control);
 
-	bonobo_ui_component_add_verb_list_with_data (icon->priv->tray_component,
-						     rb_tray_icon_verbs,
-						     icon);
+	rb_bonobo_add_listener_list_with_data (icon->priv->tray_component,
+						rb_tray_icon_listeners,
+						icon);
 }
 
 static void
@@ -328,6 +341,8 @@
 	
 	g_return_val_if_fail (tray->priv != NULL, NULL);
 
+	rb_tray_set_visibility (tray, VISIBILITY_SYNC);
+
 	return tray;
 }
 
@@ -335,10 +350,27 @@
 rb_tray_icon_button_press_event_cb (GtkWidget *ebox, GdkEventButton *event,
 				    RBTrayIcon *icon)
 {
-	/* contextmenu */
+	/* filter out double, triple clicks */
+	if (event->type != GDK_BUTTON_PRESS)
+		return;
+
 	rb_debug ("tray button press");
-	sync_menu (icon, event->button);
-	bonobo_control_do_popup (icon->priv->control, event->button, event->time);
+
+	switch (event->button) {
+	case 1:
+		rb_tray_set_visibility (icon, VISIBILITY_TOGGLE);
+		break;
+
+	case 3:
+		/* contextmenu */
+		sync_menu (icon);
+		bonobo_control_do_popup (icon->priv->control, event->button,
+								event->time);
+		break;
+
+	default:
+		break;
+	}
 }
 
 static void
@@ -397,7 +429,7 @@
 
 
 static void
-sync_menu (RBTrayIcon *tray, guint button)
+sync_menu (RBTrayIcon *tray)
 {
 	BonoboUIComponent *pcomp;
 	BonoboUINode *node;
@@ -408,19 +440,8 @@
 
 	node = bonobo_ui_component_get_tree (tray->priv->main_component, "/popups/TrayPopup", TRUE, NULL);
 
-	switch (button) {
-	case 1:
-		bonobo_ui_node_set_attr (node, "name", "button1");
-		break;
-	case 2:
-		bonobo_ui_node_set_attr (node, "name", "button2");
-		break;
-	case 3:
-		bonobo_ui_node_set_attr (node, "name", "button3");
-		break;
-	default:
-		break;
-	}
+	bonobo_ui_node_set_attr (node, "name", "button3");
+
 	bonobo_ui_component_set_tree (pcomp, "/popups", node, NULL);
 	bonobo_ui_node_free (node);
 
@@ -430,13 +451,14 @@
 }
 
 static void
-rb_tray_icon_cmd_show_window (BonoboUIComponent *component,
-			      RBTrayIcon *icon,
-			      const char *verbname)
-{
-	rb_debug ("showing window");
-	gtk_window_present (icon->priv->main_window);
-	gtk_widget_grab_focus (GTK_WIDGET (icon->priv->main_window));
+rb_tray_icon_show_window_changed_cb (BonoboUIComponent *component,
+				const char *path,
+				Bonobo_UIComponent_EventType type,
+				const char *state,
+				RBTrayIcon *icon)
+{
+	rb_debug ("show window clicked");
+	rb_tray_set_visibility (icon, atoi (state));
 }
 
 void
@@ -447,3 +469,36 @@
 			      tooltip, NULL);
 }
 
+static void
+rb_tray_set_visibility (RBTrayIcon *tray, int state)
+{
+	static int window_x = -1;
+	static int window_y = -1;
+	static gboolean visible = 1;
+
+	switch (state)
+	{
+	case VISIBILITY_HIDDEN:
+       	case VISIBILITY_VISIBLE:
+		visible = !state;
+
+        case VISIBILITY_TOGGLE:
+		visible = !visible;
+	
+		if (visible == TRUE)
+		{
+			if (window_x >= 0 && window_y >= 0)
+				gtk_window_move (tray->priv->main_window,
+						window_x, window_y );
+			gtk_widget_show (GTK_WIDGET (tray->priv->main_window));
+		} else {
+			gtk_window_get_position ( tray->priv->main_window,
+						&window_x, &window_y);
+			gtk_widget_hide (GTK_WIDGET (tray->priv->main_window));
+		}
+
+	case VISIBILITY_SYNC:
+		rb_bonobo_set_active (tray->priv->main_component,
+					CMD_PATH_SHOW_WINDOW, visible);
+	}
+}
