diff pidgin/gtkblist.c @ 19874:0ed8a2a86a1b

explicit merge of 'fc49baf44017a8fd511c607b435668baf2a0f518' and 'b50640e3caa45410064cc403c759c1b427800a1e' to branch 'org.maemo.garage.pidgin.pidgin.dialog-transience'
author Gabriel Schulhof <nix@go-nix.ca>
date Fri, 17 Aug 2007 22:10:43 +0000
parents 94a2128d139e aafa9b36344e
children 9474223e534b
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Fri Aug 17 21:01:20 2007 +0000
+++ b/pidgin/gtkblist.c	Fri Aug 17 22:10:43 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;
 }
 
@@ -3326,18 +3329,14 @@
 	}
 
 	/* XXX Good luck cleaning up this crap */
-	if (aliased) {
-		contact = (PurpleContact*)((PurpleBlistNode*)b)->parent;
-		if(contact)
-			gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data;
-
-		if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias)
-			name = contact->alias;
-		else
-			name = purple_buddy_get_alias(b);
-	} else {
-		name = b->name;
-	}
+	contact = (PurpleContact*)((PurpleBlistNode*)b)->parent;
+	if(contact)
+		gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data;
+
+	if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias)
+		name = contact->alias;
+	else
+		name = purple_buddy_get_alias(b);
 	
 	esc = g_markup_escape_text(name, strlen(name));