? mkinstalldirs
? stamp-h1
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/libwnck/ChangeLog,v
retrieving revision 1.281
diff -p -u -r1.281 ChangeLog
--- ChangeLog	3 Dec 2004 20:34:11 -0000	1.281
+++ ChangeLog	5 Dec 2004 16:35:48 -0000
@@ -1,3 +1,12 @@
+2004-12-05  Juerg Billeter  <j@bitron.ch>
+
+	* libwnck/tasklist.c: add static list to keep track of running instances
+	(wnck_tasklist_init), (wnck_tasklist_finalize): update list of running
+	instances and update window list accordingly
+	(wnck_tasklist_realize): ensure updating window list after realization
+	(wnck_tasklist_update_lists): show windows from all monitors if there
+	is only one tasklist instance running (fixes #154040 and #154041)
+
 2004-12-03  Benjamin Kahn  <xkahn@novell.com>
 
 	* When a window title is too long to fit in the space provided, 
Index: libwnck/tasklist.c
===================================================================
RCS file: /cvs/gnome/libwnck/libwnck/tasklist.c,v
retrieving revision 1.62
diff -p -u -r1.62 tasklist.c
--- libwnck/tasklist.c	3 Dec 2004 20:30:09 -0000	1.62
+++ libwnck/tasklist.c	5 Dec 2004 16:35:50 -0000
@@ -261,6 +261,8 @@ static void     wnck_tasklist_check_end_
 static gpointer task_parent_class;
 static gpointer tasklist_parent_class;
 
+static GList *tasklists;
+
 /**
  * eel_gtk_label_make_bold.
  *
@@ -514,6 +516,11 @@ wnck_tasklist_init (WnckTasklist *taskli
 
   tasklist->priv->monitor_num = -1;
 
+  /* keep track of running tasklists - to handle multi monitor setup */
+  tasklists = g_list_append (tasklists, tasklist);
+  if (g_list_length (tasklists) == 2)
+    wnck_tasklist_update_lists (WNCK_TASKLIST (tasklists->data));
+
   atk_obj = gtk_widget_get_accessible (widget);
   atk_object_set_name (atk_obj, _("Window List"));
   atk_object_set_description (atk_obj, _("Tool to switch between visible windows"));
@@ -545,6 +552,11 @@ wnck_tasklist_finalize (GObject *object)
   WnckTasklist *tasklist;
 
   tasklist = WNCK_TASKLIST (object);
+  
+  /* keep track of running tasklists - to handle multi monitor setup */
+  tasklists = g_list_remove (tasklists, tasklist);
+  if (g_list_length (tasklists) == 1)
+    wnck_tasklist_update_lists (WNCK_TASKLIST (tasklists->data));
 
   if (tasklist->priv->free_icon_loader_data != NULL)
     (* tasklist->priv->free_icon_loader_data) (tasklist->priv->icon_loader_data);
@@ -1181,6 +1193,8 @@ wnck_tasklist_realize (GtkWidget *widget
 #endif
   
   (* GTK_WIDGET_CLASS (tasklist_parent_class)->realize) (widget);
+  
+  wnck_tasklist_update_lists (tasklist);
 }
 
 static void
@@ -1506,14 +1520,26 @@ wnck_tasklist_update_lists (WnckTasklist
   
   if (GTK_WIDGET (tasklist)->window != NULL)
     {
-      monitor_num = gdk_screen_get_monitor_at_window (_wnck_screen_get_gdk_screen (tasklist->priv->screen),
-                                                      GTK_WIDGET (tasklist)->window);
+      /* show windows from all monitors if there is only one tasklist running */
+      if (g_list_length (tasklists) == 1)
+        {
+          monitor_num = -1;
+        }
+      else
+        {
+          monitor_num = gdk_screen_get_monitor_at_window (_wnck_screen_get_gdk_screen (tasklist->priv->screen),
+                                                          GTK_WIDGET (tasklist)->window);
+        }
+
       if (monitor_num != tasklist->priv->monitor_num)
         {
           tasklist->priv->monitor_num = monitor_num;
-          gdk_screen_get_monitor_geometry (_wnck_screen_get_gdk_screen (tasklist->priv->screen),
-                                           tasklist->priv->monitor_num,
-                                           &tasklist->priv->monitor_geometry);
+          if (monitor_num != -1)
+            {
+              gdk_screen_get_monitor_geometry (_wnck_screen_get_gdk_screen (tasklist->priv->screen),
+                                               tasklist->priv->monitor_num,
+                                               &tasklist->priv->monitor_geometry);
+            }
         }
     }
  
