changeset 14919:056c8a27668c

[gaim-migrate @ 17691] Change some minor stuff. This should get rid of the blinking in the buddylist (and the tooltip) when a new account signs on. This just might get rid of some crashes too. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 07 Nov 2006 02:59:24 +0000
parents f1e353fa21de
children 478e64cf96fe
files console/gntblist.c console/libgnt/gntwidget.c
diffstat 2 files changed, 33 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/console/gntblist.c	Tue Nov 07 02:53:42 2006 +0000
+++ b/console/gntblist.c	Tue Nov 07 02:59:24 2006 +0000
@@ -1163,7 +1163,8 @@
 	widget = ggblist->tree;
 	tree = GNT_TREE(widget);
 
-	if (!gnt_widget_has_focus(ggblist->tree))
+	if (!gnt_widget_has_focus(ggblist->tree) || 
+			(ggblist->context && !GNT_WIDGET_IS_FLAG_SET(ggblist->context, GNT_WIDGET_INVISIBLE)))
 		return;
 
 	if (ggblist->tooltip)
@@ -1183,8 +1184,12 @@
 		GaimBuddy *pr = gaim_contact_get_priority_buddy((GaimContact*)node);
 		gboolean offline = !GAIM_BUDDY_IS_ONLINE(pr);
 		gboolean showoffline = gaim_prefs_get_bool(PREF_ROOT "/showoffline");
+		const char *alias = gaim_contact_get_alias((GaimContact*)node);
+		const char *name = gaim_buddy_get_name(pr);
 
-		title = g_strdup(gaim_contact_get_alias((GaimContact*)node));
+		title = g_strdup(alias);
+		if (g_utf8_collate(alias, name))
+			g_string_append_printf(str, _("Nickname: %s\n"), gaim_buddy_get_name(pr));
 		tooltip_for_buddy(pr, str);
 		for (node = node->child; node; node = node->next) {
 			if (offline) {
@@ -1887,7 +1892,7 @@
 }
 
 static void
-send_im_select(void)
+send_im_select(GntMenuItem *item, gpointer n)
 {
 	GaimRequestFields *fields;
 	GaimRequestFieldGroup *group;
--- a/console/libgnt/gntwidget.c	Tue Nov 07 02:53:42 2006 +0000
+++ b/console/libgnt/gntwidget.c	Tue Nov 07 02:59:24 2006 +0000
@@ -303,11 +303,8 @@
 void
 gnt_widget_show(GntWidget *widget)
 {
-	/* Draw the widget and take focus */
-	/*if (GNT_WIDGET_FLAGS(widget) & GNT_WIDGET_CAN_TAKE_FOCUS) {*/
-		/*gnt_widget_take_focus(widget);*/
-	/*}*/
 	gnt_widget_draw(widget);
+	gnt_screen_occupy(widget);
 }
 
 void
@@ -324,39 +321,38 @@
 
 	if (widget->window == NULL)
 	{
+		int x, y, maxx, maxy, w, h;
 		gboolean shadow = TRUE;
 
 		if (!gnt_widget_has_shadow(widget))
 			shadow = FALSE;
 
+		x = widget->priv.x;
+		y = widget->priv.y;
+		w = widget->priv.width + shadow;
+		h = widget->priv.height + shadow;
+
+		getmaxyx(stdscr, maxy, maxx);
+		maxy -= 1;		/* room for the taskbar */
+
+		x = MAX(0, x);
+		y = MAX(0, y);
+		if (x + w >= maxx)
+			x = MAX(0, maxx - w);
+		if (y + h >= maxy)
+			y = MAX(0, maxy - h);
+
+		w = MIN(w, maxx);
+		h = MIN(h, maxy);
+
+		widget->priv.x = x;
+		widget->priv.y = y;
+		widget->priv.width = w - shadow;
+		widget->priv.height = h - shadow;
+
 		widget->window = newwin(widget->priv.height + shadow, widget->priv.width + shadow,
 						widget->priv.y, widget->priv.x);
-		if (widget->window == NULL)     /* The size is probably too large for the screen */
-		{
-			int x = widget->priv.x, y = widget->priv.y;
-			int w = widget->priv.width + shadow, h = widget->priv.height + shadow;
-			int maxx, maxy;            /* Max-X is cool */
-
-			getmaxyx(stdscr, maxy, maxx);
-
-			if (x + w >= maxx)
-				x = MAX(0, maxx - w);
-			if (y + h >= maxy)
-				y = MAX(0, maxy - h);
-
-			w = MIN(w, maxx);
-			h = MIN(h, maxy);
-
-			widget->priv.x = x;
-			widget->priv.y = y;
-			widget->priv.width = w - shadow;
-			widget->priv.height = h - shadow;
-
-			widget->window = newwin(widget->priv.height + shadow, widget->priv.width + shadow,
-							widget->priv.y, widget->priv.x);
-		}
 		init_widget(widget);
-		gnt_screen_occupy(widget);
 	}
 
 	g_signal_emit(widget, signals[SIG_DRAW], 0);