? current.patch
? patches
? simple-example
? simple-example.c
? stamp-h1
? testit
? testit.c
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.374
diff -p -u -r1.374 window.c
--- src/window.c	9 Feb 2005 03:18:46 -0000	1.374
+++ src/window.c	10 Feb 2005 07:04:47 -0000
@@ -3604,13 +3604,38 @@ meta_window_set_current_workspace_hint (
   meta_error_trap_pop (window->display, FALSE);
 }
 
+static gboolean
+find_root_ancestor (MetaWindow *window,
+                    void       *data)
+{
+  MetaWindow **ancestor = data;
+
+  /* Overwrite the previously "most-root" ancestor with the new one found */
+  *ancestor = window;
+
+  /* We want this to continue until meta_window_foreach_ancestor quits because
+   * there are no more valid ancestors.
+   */
+  return TRUE;
+}
+
 void
 meta_window_raise (MetaWindow  *window)
 {
+  MetaWindow *ancestor;
+  ancestor = window;
+  meta_window_foreach_ancestor (window, find_root_ancestor, &ancestor);
+
   meta_topic (META_DEBUG_WINDOW_OPS,
-              "Raising window %s\n", window->desc);
+              "Raising window %s, ancestor of %s\n", 
+              ancestor->desc, window->desc);
+
+  /* This should be true unless we revisit bug 152003 (make stacks be
+   * per-workspace instead of per-screen)
+   */
+  g_assert (window->screen->stack == ancestor->screen->stack);
 
-  meta_stack_raise (window->screen->stack, window);
+  meta_stack_raise (window->screen->stack, ancestor);
 }
 
 void
