Index: src/place.c
===================================================================
RCS file: /cvs/gnome/metacity/src/place.c,v
retrieving revision 1.38
diff -p -u -r1.38 place.c
--- src/place.c	22 Dec 2004 23:52:52 -0000	1.38
+++ src/place.c	27 Jan 2005 07:11:08 -0000
@@ -748,9 +748,10 @@ meta_window_place (MetaWindow        *wi
       {
         MetaWindow *w = tmp->data;
 
-        if (!w->minimized &&
+        if (meta_window_showing_on_its_workspace (w) &&
             w != window && 
-            window->workspace == w->workspace)
+            (window->workspace == w->workspace ||
+             window->on_all_workspaces || w->on_all_workspaces))
           windows = g_list_prepend (windows, w);
 
         tmp = tmp->next;
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.365
diff -p -u -r1.365 window.c
--- src/window.c	26 Jan 2005 23:25:05 -0000	1.365
+++ src/window.c	27 Jan 2005 07:11:10 -0000
@@ -94,8 +94,6 @@ static void     ensure_mru_position_afte
 
 void meta_window_move_resize_now (MetaWindow  *window);
 
-static gboolean window_showing_on_its_workspace (MetaWindow *window);
-
 /* FIXME we need an abstraction that covers all these queues. */   
 
 void meta_window_unqueue_calc_showing (MetaWindow *window);
@@ -1131,7 +1129,7 @@ set_net_wm_state (MetaWindow *window)
       data[i] = window->display->atom_net_wm_state_fullscreen;
       ++i;
     }
-  if (!window_showing_on_its_workspace (window))
+  if (!meta_window_showing_on_its_workspace (window))
     {
       data[i] = window->display->atom_net_wm_state_hidden;
       ++i;
@@ -1195,8 +1193,8 @@ ancestor_is_minimized (MetaWindow *windo
   return is_minimized;
 }
 
-static gboolean
-window_showing_on_its_workspace (MetaWindow *window)
+gboolean
+meta_window_showing_on_its_workspace (MetaWindow *window)
 {
   gboolean showing;
   gboolean is_desktop_or_dock;
@@ -1280,7 +1278,7 @@ meta_window_should_be_showing (MetaWindo
   if (window->on_all_workspaces)
     meta_verbose ("Window %s is on all workspaces\n", window->desc);
 
-  return on_workspace && window_showing_on_its_workspace (window);
+  return on_workspace && meta_window_showing_on_its_workspace (window);
 }
 
 static void
Index: src/window.h
===================================================================
RCS file: /cvs/gnome/metacity/src/window.h,v
retrieving revision 1.112
diff -p -u -r1.112 window.h
--- src/window.h	28 Dec 2004 06:01:42 -0000	1.112
+++ src/window.h	27 Jan 2005 07:11:10 -0000
@@ -388,6 +388,9 @@ void        meta_window_resize_with_grav
 void        meta_window_fill_horizontal     (MetaWindow  *window);
 void        meta_window_fill_vertical       (MetaWindow  *window);
 
+/* Return whether the window would be showing if we were on its workspace */
+gboolean    meta_window_showing_on_its_workspace (MetaWindow *window);
+
 /* Return whether the window should be currently mapped */
 gboolean    meta_window_should_be_showing   (MetaWindow  *window);
 
