changeset 15352:70407d31099b

[gaim-migrate @ 18144] - Un-urgent blist on receiving focus - Urgentize on auth alerts committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 17 Jan 2007 09:12:01 +0000
parents 682908b965cf
children 916e438a314e
files gtk/gtkblist.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkblist.c	Wed Jan 17 08:58:26 2007 +0000
+++ b/gtk/gtkblist.c	Wed Jan 17 09:12:01 2007 +0000
@@ -4003,6 +4003,13 @@
 /* End of connection error handling stuff */
 /******************************************/
 
+static int
+blist_focus_cb(GtkWidget *widget, gpointer data, GaimGtkBuddyList *gtkblist)
+{
+	gaim_gtk_set_urgent(GTK_WINDOW(gtkblist->window), FALSE);
+	return 0;
+}
+
 #if 0
 static GtkWidget *
 kiosk_page()
@@ -4082,6 +4089,8 @@
 	gtkblist->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 	gtk_window_set_role(GTK_WINDOW(gtkblist->window), "buddy_list");
 	gtk_window_set_title(GTK_WINDOW(gtkblist->window), _("Buddy List"));
+	g_signal_connect(G_OBJECT(gtkblist->window), "focus-in-event",
+			 G_CALLBACK(blist_focus_cb), gtkblist);
 	GTK_WINDOW(gtkblist->window)->allow_shrink = TRUE;
 
 	gtkblist->main_vbox = gtk_vbox_new(FALSE, 0);
@@ -5692,6 +5701,8 @@
 void gaim_gtk_blist_add_alert(GtkWidget *widget)
 {
 	gtk_container_add(GTK_CONTAINER(gtkblist->scrollbook), widget);
+	if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
+		gaim_gtk_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
 }
 
 void
@@ -5708,7 +5719,8 @@
 	gtkblist->headline_callback = callback;
 	gtkblist->headline_data = user_data;
 	gtkblist->headline_destroy = destroy;
-	gaim_gtk_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
+	if (!GTK_WIDGET_HAS_FOCUS(gtkblist->window))
+		gaim_gtk_set_urgent(GTK_WINDOW(gtkblist->window), TRUE);
 	gtk_widget_show_all(gtkblist->headline_hbox);
 }