changeset 19187:d2c5d41ed7e1

Destroy the tooltip when a conversation window is closed.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Mon, 13 Aug 2007 00:45:46 +0000
parents cdb0fbe5de7b
children 6d0e10a6ee35
files pidgin/gtkblist.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Sat Aug 11 13:37:14 2007 +0000
+++ b/pidgin/gtkblist.c	Mon Aug 13 00:45:46 2007 +0000
@@ -2608,6 +2608,7 @@
 	gboolean tooltip_top = FALSE;
 	struct _pidgin_blist_node *gtknode;
 	GdkRectangle mon_size;
+	int sig;
 	
 	if (node == NULL)
 		return;
@@ -2618,7 +2619,6 @@
 	 */
 	pidgin_blist_tooltip_destroy();
 
-
 	gtkblist->tipwindow = gtk_window_new(GTK_WINDOW_POPUP);
 
 	if(PURPLE_BLIST_NODE_IS_CHAT(node) || PURPLE_BLIST_NODE_IS_BUDDY(node)) {
@@ -2673,7 +2673,6 @@
 			G_CALLBACK(pidgin_blist_paint_tip), NULL);
 	gtk_widget_ensure_style (gtkblist->tipwindow);
 
-
 #if GTK_CHECK_VERSION(2,2,0)
 	gdk_display_get_pointer(gdk_display_get_default(), &screen, &x, &y, NULL);
 	mon_num = gdk_screen_get_monitor_at_point(screen, x, y);
@@ -2722,6 +2721,10 @@
 	gtk_window_move(GTK_WINDOW(gtkblist->tipwindow), x, y);
 	gtk_widget_show(gtkblist->tipwindow);
 
+	/* Hide the tooltip when the widget is destroyed */
+	sig = g_signal_connect(G_OBJECT(widget), "destroy", G_CALLBACK(pidgin_blist_tooltip_destroy), NULL);
+	g_signal_connect_swapped(G_OBJECT(gtkblist->tipwindow), "destroy", G_CALLBACK(g_source_remove), GINT_TO_POINTER(sig));
+
 	return;
 }