? core.22407
? core.23036
? rb-tray-icon-crash.patch
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/Makefile.am,v
retrieving revision 1.27
diff -u -r1.27 Makefile.am
--- Makefile.am	1 Sep 2003 04:21:12 -0000	1.27
+++ Makefile.am	8 Sep 2003 18:18:45 -0000
@@ -71,4 +71,4 @@
 
 BUILT_SOURCES = $(tab_files)
 
-CLEANFILES = $(BUILT_SOURCES)
+CLEANFILES = $(BUILT_SOURCES) Rhythmbox*.[ch]
Index: main.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/main.c,v
retrieving revision 1.31
diff -u -r1.31 main.c
--- main.c	5 Sep 2003 06:05:24 -0000	1.31
+++ main.c	8 Sep 2003 18:18:45 -0000
@@ -46,6 +46,7 @@
 #include "rb-thread-helpers.h"
 #include "rb-stock-icons.h"
 #include "eel-gconf-extensions.h"
+#include "Rhythmbox.h"
 
 static gboolean rb_init (RBShell *shell);
 static gboolean sound_error_dialog (gpointer unused);
Index: rb-shell.c
===================================================================
RCS file: /cvs/gnome/rhythmbox/shell/rb-shell.c,v
retrieving revision 1.184
diff -u -r1.184 rb-shell.c
--- rb-shell.c	5 Sep 2003 06:05:24 -0000	1.184
+++ rb-shell.c	8 Sep 2003 18:18:49 -0000
@@ -44,7 +44,7 @@
 #include <stdio.h>
 #include <sys/stat.h>
 
-#include "Rhythmbox.h"
+#include <Rhythmbox.h>
 #include "rb-shell.h"
 #include "rb-debug.h"
 #include "rb-dialog.h"
@@ -226,7 +226,7 @@
 static gboolean rb_shell_show_popup_cb (RBSourceList *sourcelist,
 					RBSource *target,
 					RBShell *shell);
-static void tray_deleted_cb (GtkWidget *win, GdkEventAny *event, RBShell *shell);
+static gboolean tray_destroy_cb (GtkWidget *win, GdkEventAny *event, RBShell *shell);
 
 static const GtkTargetEntry target_table[] =
 	{
@@ -708,7 +708,7 @@
 	shell->priv->library = rb_library_new ();
 
 	rb_debug ("shell: setting up tray icon");
-	tray_deleted_cb (NULL, NULL, shell);
+	tray_destroy_cb (NULL, NULL, shell);
 
 	bonobo_ui_component_add_verb_list_with_data (shell->priv->ui_component,
 						     rb_shell_verbs,
@@ -1215,7 +1215,7 @@
 {
 	gboolean playing = rb_shell_player_get_playing (shell->priv->player_shell);
 	char *tooltip;
-		
+
 	if (shell->priv->cached_title == NULL) 
 		tooltip = g_strdup (_("Not playing"));
 	else if (!playing) {
@@ -1225,7 +1225,7 @@
 		tooltip = g_strdup_printf (_("%s\n%s remaining"),
 					   shell->priv->cached_title, duration);
 	}
-	
+
 	rb_tray_icon_set_tooltip (shell->priv->tray_icon, tooltip);
 	g_free (tooltip);
 }
@@ -1750,9 +1750,11 @@
 	return rb_source_show_popup (target);
 }
 
-static void
-tray_deleted_cb (GtkWidget *win, GdkEventAny *event, RBShell *shell)
+static gboolean
+tray_destroy_cb (GtkWidget *win, GdkEventAny *event, RBShell *shell)
 {
+	shell->priv->tray_icon = NULL;
+
 	if (shell->priv->tray_icon) {
 		rb_debug ("caught delete_event for tray icon");
 		gtk_object_sink (GTK_OBJECT (shell->priv->tray_icon));
@@ -1763,6 +1765,10 @@
 						   shell->priv->ui_component,
 						   shell->priv->library,
 						   GTK_WINDOW (shell->priv->window));
-	g_signal_connect (G_OBJECT (shell->priv->tray_icon), "delete_event",
-			  G_CALLBACK (tray_deleted_cb), shell);
+	g_signal_connect (G_OBJECT (shell->priv->tray_icon), "destroy-event",
+			  G_CALLBACK (tray_destroy_cb), shell);
+
+	gtk_widget_show_all (GTK_WIDGET (shell->priv->tray_icon));
+
+	return TRUE;
 }
