Index: ChangeLog
===================================================================
--- ChangeLog	(révision 10018)
+++ ChangeLog	(copie de travail)
@@ -1,3 +1,11 @@
+Sun Jan 15 00:19:53 CET 2006  Guillaume Desmottes <cass@skynet.be>
+	* src/fe-gnome/main-window.c:
+	* src/fe-gnome/fe-gnome.c:
+	  - Turn on window urgency flag when nick highlighting and
+	    receive a private message. (#326970)
+	  - Use gui.main_window instead of getting the main window
+	    widget with glade_xml_get_widget().
+
 Wed Jan 11 20:59:35 MST 2006  David Trowbridge <trowbrds@gmail.com>
 
 	* src/fe-gnome/text-entry.c:
Index: src/fe-gnome/main-window.c
===================================================================
--- src/fe-gnome/main-window.c	(révision 10018)
+++ src/fe-gnome/main-window.c	(copie de travail)
@@ -92,6 +92,8 @@
 static gboolean on_resize (GtkWidget *widget, GdkEventConfigure *event, gpointer data);
 static gboolean on_hpane_move (GtkPaned *widget, GParamSpec *param_spec, gpointer data);
 
+static void on_main_window_focus_in (GtkWidget * widget, GdkEventFocus * event, gpointer data);
+
 static GtkActionEntry action_entries [] = {
 
 	/* Toplevel */
@@ -153,6 +155,8 @@
 	gui.main_window = glade_xml_get_widget (gui.xml, "xchat-gnome");
 	g_signal_connect (G_OBJECT (gui.main_window), "delete-event",
 	                  G_CALLBACK (on_main_window_close), NULL);
+	g_signal_connect (G_OBJECT (gui.main_window), "focus-in-event",
+	                  G_CALLBACK (on_main_window_focus_in), NULL);
 
 	/* hook up the menus */
 	gui.action_group = gtk_action_group_new ("MenuAction");
@@ -690,3 +694,9 @@
 			gtk_button_set_label (GTK_BUTTON (nick), newnick);
 	}
 }
+
+static void
+on_main_window_focus_in (GtkWidget * widget, GdkEventFocus * event, gpointer data)
+{
+	gtk_window_set_urgency_hint (GTK_WINDOW (widget), FALSE);
+}
Index: src/fe-gnome/fe-gnome.c
===================================================================
--- src/fe-gnome/fe-gnome.c	(révision 10018)
+++ src/fe-gnome/fe-gnome.c	(copie de travail)
@@ -285,6 +285,8 @@
 fe_set_hilight (struct session *sess)
 {
 	navigation_model_set_hilight (gui.tree_model, sess);
+	if (!gtk_window_is_active (GTK_WINDOW (gui.main_window)))
+		gtk_window_set_urgency_hint (GTK_WINDOW (gui.main_window), TRUE);
 }
 
 void
@@ -391,6 +393,9 @@
 	conversation_panel_print (CONVERSATION_PANEL (gui.conversation_panel), sess, text, prefs.indent_nicks);
 	sess->new_data = TRUE;
 	navigation_model_set_hilight (gui.tree_model, sess);
+	if (sess->nick_said)
+		if (!gtk_window_is_active (GTK_WINDOW (gui.main_window)))
+			gtk_window_set_urgency_hint (GTK_WINDOW (gui.main_window), TRUE);
 }
 
 void
@@ -614,16 +619,14 @@
 void
 fe_ctrl_gui (session * sess, int action, int arg)
 {
-	GtkWidget *window = glade_xml_get_widget (gui.xml, "xchat-gnome");
-
 	switch (action) {
 	case 0:
-		gtk_widget_hide (window);
+		gtk_widget_hide (gui.main_window);
 		break;
 
 	case 1:
-		gtk_widget_show (window);
-		gtk_window_present (GTK_WINDOW (window));
+		gtk_widget_show (gui.main_window);
+		gtk_window_present (GTK_WINDOW (gui.main_window));
 		break;
 
 	case 2:
@@ -636,7 +639,7 @@
 		break;
 
 	case 5:
-		gtk_window_iconify (GTK_WINDOW (window));
+		gtk_window_iconify (GTK_WINDOW (gui.main_window));
 		break;
 	}
 }
@@ -649,13 +652,11 @@
 int
 fe_gui_info (session * sess, int info_type)
 {
-	GtkWidget *window = glade_xml_get_widget (gui.xml, "xchat-gnome");
-
 	switch (info_type) {
 	case 0:
-		if (!GTK_WIDGET_VISIBLE (GTK_WINDOW (window)))
+		if (!GTK_WIDGET_VISIBLE (GTK_WINDOW (gui.main_window)))
 			return 2;
-		if (gtk_window_is_active (GTK_WINDOW (window)))
+		if (gtk_window_is_active (GTK_WINDOW (gui.main_window)))
 			return 1;
 		return 0;
 		break;
