Index: libwnck/tasklist.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/tasklist.c,v
retrieving revision 1.78
diff -u -p -r1.78 tasklist.c
--- libwnck/tasklist.c	16 Jun 2005 17:32:36 -0000	1.78
+++ libwnck/tasklist.c	17 Jul 2005 14:54:05 -0000
@@ -1878,10 +1878,12 @@ static void
 wnck_tasklist_active_window_changed (WnckScreen   *screen,
 				     WnckTasklist *tasklist)
 {
-  WnckWindow *active_window;
+  WnckWindow *active_window, *tmp_window;
   WnckTask *active_task;
   
-  active_window = wnck_screen_get_active_window (screen);
+  for (tmp_window = wnck_screen_get_active_window (screen);
+       tmp_window; tmp_window = wnck_window_get_transient(tmp_window))
+    active_window = tmp_window;
 
   active_task = g_hash_table_lookup (tasklist->priv->win_hash,
 				     active_window);
Index: libwnck/window.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.c,v
retrieving revision 1.55
diff -u -p -r1.55 window.c
--- libwnck/window.c	16 Jun 2005 17:32:36 -0000	1.55
+++ libwnck/window.c	17 Jul 2005 14:54:07 -0000
@@ -480,6 +480,14 @@ wnck_window_get_application  (WnckWindow
   return window->priv->app;
 }
 
+WnckWindow*
+wnck_window_get_transient (WnckWindow *window)
+{
+  g_return_val_if_fail (WNCK_IS_WINDOW (window), None);
+
+  return wnck_window_get (window->priv->transient_for);
+}
+
 gulong
 wnck_window_get_group_leader (WnckWindow *window)
 {
Index: libwnck/window.h
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/window.h,v
retrieving revision 1.32
diff -u -p -r1.32 window.h
--- libwnck/window.h	16 Jun 2005 17:32:36 -0000	1.32
+++ libwnck/window.h	17 Jul 2005 14:54:07 -0000
@@ -137,6 +137,7 @@ const char* wnck_window_get_name      (W
 const char* wnck_window_get_icon_name (WnckWindow *window);
 
 WnckApplication* wnck_window_get_application  (WnckWindow *window);
+WnckWindow*      wnck_window_get_transient    (WnckWindow *window);
 gulong           wnck_window_get_group_leader (WnckWindow *window);
 gulong           wnck_window_get_xid          (WnckWindow *window);
 
