Index: shell/rb-shell.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell.c,v
retrieving revision 1.97
diff -u -r1.97 rb-shell.c
--- shell/rb-shell.c	18 Nov 2002 00:23:15 -0000	1.97
+++ shell/rb-shell.c	28 Nov 2002 11:31:34 -0000
@@ -2005,12 +2005,21 @@
 	gtk_drag_finish (context, TRUE, FALSE, time);
 }
 
+static gboolean
+tray_destroyed (GtkWidget *widget, GdkEvent *event, gpointer user_data)
+{
+	g_print ("Got destroy event\n");
+        setup_tray_icon ((RBShell *)user_data);
+         return TRUE;
+}
+
 static void
 setup_tray_icon (RBShell *shell)
 {
 	GtkWidget *ebox, *image;
 	BonoboControlFrame *frame;
 
+	g_print ("In setup_tray_icon\n");
 	shell->priv->tray_icon_tooltip = gtk_tooltips_new ();
 
 	shell->priv->tray_icon = egg_tray_icon_new ("Rhythmbox tray icon");
@@ -2040,6 +2049,9 @@
 					      NULL);
 	gtk_container_add (GTK_CONTAINER (shell->priv->tray_icon),
 			   bonobo_control_frame_get_widget (frame));
+
+	g_signal_connect (G_OBJECT (shell->priv->tray_icon), "destroy-event",
+			  G_CALLBACK (tray_destroyed), (gpointer) shell);
 
 	gtk_widget_show_all (GTK_WIDGET (ebox));
 }
