changeset 5172:2d84fe476406

[gaim-migrate @ 5536] crashing == bad committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 18 Apr 2003 23:01:00 +0000
parents 173ff9946424
children bfd1e4c681a1
files plugins/ticker/ticker.c
diffstat 1 files changed, 12 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/ticker/ticker.c	Fri Apr 18 22:20:01 2003 +0000
+++ b/plugins/ticker/ticker.c	Fri Apr 18 23:01:00 2003 +0000
@@ -54,8 +54,12 @@
 /* for win32 compatability */
 G_MODULE_IMPORT GSList *connections;
 
-static void buddy_ticker_destroy_window(GtkWidget *window, gpointer data) {
-	gtk_widget_hide(window);
+static gboolean buddy_ticker_destroy_window(GtkWidget *window,
+		GdkEventAny *event, gpointer data) {
+	if(window)
+		gtk_widget_hide(window);
+
+	return TRUE; /* don't actually destroy the window */
 }
 
 static void buddy_ticker_create_window() {
@@ -65,7 +69,7 @@
 	}
 
 	tickerwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-	g_signal_connect(G_OBJECT(tickerwindow), "destroy",
+	g_signal_connect(G_OBJECT(tickerwindow), "delete_event",
 			G_CALLBACK (buddy_ticker_destroy_window), NULL);
 	gtk_window_set_title (GTK_WINDOW(tickerwindow), _("Buddy Ticker"));
 	gtk_window_set_role (GTK_WINDOW(tickerwindow), "ticker");
@@ -118,6 +122,7 @@
 	TickerData *td;
 
 	buddy_ticker_create_window();
+
 	if (!ticker)
 		return;
 
@@ -151,6 +156,9 @@
 	if (!td)
 		return;
 
+	/* pop up the ticker window again */
+	buddy_ticker_create_window();
+
 	gtk_ticker_remove(GTK_TICKER(ticker), td->ebox);
 	tickerbuds = g_list_remove(tickerbuds, td);
 	g_free(td);
@@ -235,7 +243,7 @@
 }
 
 G_MODULE_EXPORT void gaim_plugin_remove() {
-	buddy_ticker_destroy_window(tickerwindow, NULL);
+	buddy_ticker_destroy_window(tickerwindow, NULL, NULL);
 }
 
 struct gaim_plugin_description desc;