Index: src/screen.c
===================================================================
RCS file: /cvs/gnome/metacity/src/screen.c,v
retrieving revision 1.127
diff -p -u -r1.127 screen.c
--- src/screen.c	7 Aug 2004 16:33:11 -0000	1.127
+++ src/screen.c	25 Aug 2004 17:21:32 -0000
@@ -1095,7 +1095,8 @@ update_num_workspaces (MetaScreen *scree
   
   while (i < new_num)
     {
-      meta_workspace_new (screen);
+      meta_workspace_initialize_from (meta_workspace_new (screen),
+                                      screen->active_workspace);
       ++i;
     }
 
Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.341
diff -p -u -r1.341 window.c
--- src/window.c	19 Aug 2004 02:05:24 -0000	1.341
+++ src/window.c	25 Aug 2004 17:21:32 -0000
@@ -7298,7 +7298,7 @@ meta_window_stack_just_below (MetaWindow
       meta_topic (META_DEBUG_STACK,
                   "Setting stack position of window %s to %d (making it below window %s).\n",
                   window->desc, 
-                  below_this_one->stack_position - 1, 
+                  below_this_one->stack_position, 
                   below_this_one->desc);
       meta_window_set_stack_position (window, below_this_one->stack_position - 1);
     }
Index: src/workspace.c
===================================================================
RCS file: /cvs/gnome/metacity/src/workspace.c,v
retrieving revision 1.59
diff -p -u -r1.59 workspace.c
--- src/workspace.c	6 Aug 2004 18:13:55 -0000	1.59
+++ src/workspace.c	25 Aug 2004 17:21:32 -0000
@@ -60,6 +60,26 @@ meta_workspace_new (MetaScreen *screen)
 }
 
 void
+meta_workspace_initialize_from (MetaWorkspace *new_workspace,
+                                MetaWorkspace *from_this_one)
+{
+  GList* windows;
+
+  windows = from_this_one->windows;
+  while (windows != NULL)
+    {
+      MetaWindow *window = windows->data;
+      windows = windows->next;
+
+      if (window->on_all_workspaces)
+        {
+          new_workspace->mru_list = g_list_prepend (new_workspace->mru_list, window);
+          window->workspaces = g_list_prepend (window->workspaces, new_workspace);
+	}
+    }
+}
+
+void
 meta_workspace_free (MetaWorkspace *workspace)
 {
   GList *tmp;
Index: src/workspace.h
===================================================================
RCS file: /cvs/gnome/metacity/src/workspace.h,v
retrieving revision 1.17
diff -p -u -r1.17 workspace.h
--- src/workspace.h	15 Aug 2003 22:09:55 -0000	1.17
+++ src/workspace.h	25 Aug 2004 17:21:32 -0000
@@ -52,6 +52,8 @@ struct _MetaWorkspace
 };
 
 MetaWorkspace* meta_workspace_new           (MetaScreen    *screen);
+void           meta_workspace_initialize_from (MetaWorkspace *new_workspace,
+                                               MetaWorkspace *from_this_one);
 void           meta_workspace_free          (MetaWorkspace *workspace);
 void           meta_workspace_add_window    (MetaWorkspace *workspace,
                                              MetaWindow    *window);
