? INSTALL
? bug-121556.patch
? depcomp
? install-sh
? missing
? mkinstalldirs
? stamp-h1
Index: libwnck/tasklist.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/tasklist.c,v
retrieving revision 1.68
diff -p -u -r1.68 tasklist.c
--- libwnck/tasklist.c	6 Jan 2005 20:09:23 -0000	1.68
+++ libwnck/tasklist.c	11 Jan 2005 19:11:56 -0000
@@ -1940,7 +1940,7 @@ wnck_tasklist_activate_task_window     (
     }
   else
     {
-      if (task->was_active)
+      if (task->was_active || wnck_window_transient_is_active (task->window))
 	{
 	  task->was_active = FALSE;
 	  wnck_window_minimize (task->window);
Index: libwnck/window.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.c,v
retrieving revision 1.48
diff -p -u -r1.48 window.c
--- libwnck/window.c	21 Sep 2004 14:51:11 -0000	1.48
+++ libwnck/window.c	11 Jan 2005 19:11:56 -0000
@@ -1161,6 +1161,44 @@ wnck_window_activate_transient (WnckWind
     }
 }
 
+/**
+ * wnck_window_transient_is_active:
+ * @window: a #WnckWindow
+ *
+ * Return whether @window or one of its transients has focus.  This
+ * function is needed because clicking on the tasklist once will
+ * activate a transient instead of the window itself
+ * (wnck_window_activate_transient), and clicking again should
+ * minimize the window and it's transients.  (Not doing this can be
+ * especially annoying in the case of modal dialogs that don't appear
+ * in the tasklist).
+ * 
+ **/
+gboolean
+wnck_window_transient_is_active (WnckWindow *window)
+{
+  GList *windows;
+  WnckWindow *transient;
+  
+  if (!WNCK_IS_WINDOW (window))
+    return FALSE;
+
+  windows = wnck_screen_get_windows_stacked (window->priv->screen);
+
+  transient = window;
+  while (transient = find_last_transient_for (windows, transient->priv->xwindow))
+    {
+      /* catch transient cycles */
+      if (transient == window)
+        return FALSE;
+
+      if (wnck_window_is_active (transient))
+        return TRUE;
+    }
+
+  return FALSE;
+}
+
 static void
 get_icons (WnckWindow *window)
 {
Index: libwnck/window.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.h,v
retrieving revision 1.27
diff -p -u -r1.27 window.h
--- libwnck/window.h	21 Sep 2004 14:51:11 -0000	1.27
+++ libwnck/window.h	11 Jan 2005 19:11:56 -0000
@@ -195,7 +195,7 @@ void     wnck_window_activate  (WnckWind
 gboolean wnck_window_is_active (WnckWindow *window);
 gboolean wnck_window_is_most_recently_activated (WnckWindow *window);
 void     wnck_window_activate_transient (WnckWindow *window);
-
+gboolean wnck_window_transient_is_active (WnckWindow *window);
 
 GdkPixbuf* wnck_window_get_icon      (WnckWindow *window);
 GdkPixbuf* wnck_window_get_mini_icon (WnckWindow *window);
