diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' metacity-2.4.34.orig/src/display.c metacity-2.4.34/src/display.c
--- metacity-2.4.34.orig/src/display.c	2003-02-04 22:46:06.000000000 -0500
+++ metacity-2.4.34/src/display.c	2003-03-06 11:45:34.000000000 -0500
@@ -262,7 +262,8 @@
     "_NET_STARTUP_ID",
     "_METACITY_TOGGLE_VERBOSE",
     "_METACITY_UPDATE_COUNTER",
-    "SYNC_COUNTER"
+    "SYNC_COUNTER",
+    "_NET_WM_SAVE_ID"
   };
   Atom atoms[G_N_ELEMENTS(atom_names)];
   
@@ -400,6 +401,7 @@
   display->atom_metacity_toggle_verbose = atoms[78];
   display->atom_metacity_update_counter = atoms[79];
   display->atom_sync_counter = atoms[80];
+  display->atom_net_wm_save_id = atoms[81];
   
   display->prop_hooks = NULL;
   meta_display_init_window_prop_hooks (display);
diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' metacity-2.4.34.orig/src/display.h metacity-2.4.34/src/display.h
--- metacity-2.4.34.orig/src/display.h	2003-02-04 22:46:06.000000000 -0500
+++ metacity-2.4.34/src/display.h	2003-03-06 11:46:49.000000000 -0500
@@ -169,6 +169,7 @@
   Atom atom_metacity_toggle_verbose;
   Atom atom_metacity_update_counter;
   Atom atom_sync_counter;
+  Atom atom_net_wm_save_id;
   
   /* This is the actual window from focus events,
    * not the one we last set
diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' metacity-2.4.34.orig/src/screen.c metacity-2.4.34/src/screen.c
--- metacity-2.4.34.orig/src/screen.c	2003-02-04 22:46:06.000000000 -0500
+++ metacity-2.4.34/src/screen.c	2003-03-06 11:45:34.000000000 -0500
@@ -90,7 +90,7 @@
 static int
 set_supported_hint (MetaScreen *screen)
 {
-#define N_SUPPORTED 45
+#define N_SUPPORTED 46
 #define N_WIN_SUPPORTED 1
   Atom atoms[N_SUPPORTED];
   
@@ -139,6 +139,7 @@
   atoms[42] = screen->display->atom_net_wm_state_above;
   atoms[43] = screen->display->atom_net_wm_state_below;
   atoms[44] = screen->display->atom_net_startup_id;
+  atoms[45] = screen->display->atom_net_wm_save_id;
   
   XChangeProperty (screen->display->xdisplay, screen->xroot,
                    screen->display->atom_net_supported,
diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' metacity-2.4.34.orig/src/xprops.c metacity-2.4.34/src/xprops.c
--- metacity-2.4.34.orig/src/xprops.c	2002-12-17 13:26:08.000000000 -0500
+++ metacity-2.4.34/src/xprops.c	2003-03-06 11:45:34.000000000 -0500
@@ -201,7 +201,10 @@
       results->type == None)
     {
       if (results->prop)
+	{
         XFree (results->prop);
+	  results->prop = NULL;
+	}
       meta_error_trap_pop_with_return (display, TRUE);
       return FALSE;
     }
@@ -209,7 +212,10 @@
   if (meta_error_trap_pop_with_return (display, TRUE) != Success)
     {
       if (results->prop)
+	{
         XFree (results->prop);
+	  results->prop = NULL;
+	}
       return FALSE;
     }
 
@@ -332,6 +338,38 @@
 }
 
 gboolean
+meta_prop_get_save_id (MetaDisplay   *display,
+		       Window         xwindow,
+		       Atom           xatom,
+		       char         **save_id)
+{
+  GetPropertyResults results;
+
+  if (!get_property (display, xwindow, xatom, AnyPropertyType,
+		     &results))
+    {
+      meta_verbose ("History Save ID wasn't set on this window.\n");
+      return FALSE;
+    }
+  if (results.type == None || results.n_items <= 0)
+    {
+      meta_verbose ("History Save ID was set to NULL.  We need to forget this window's state.\n");
+      *save_id = NULL;
+      if (results.prop)
+	{
+	  XFree (results.prop);
+	  results.prop = NULL;
+	}
+      return TRUE;
+    }
+
+  *save_id = g_strdup (results.prop);
+  XFree (results.prop);
+
+  return TRUE;
+}
+
+gboolean
 meta_prop_get_motif_hints (MetaDisplay   *display,
                            Window         xwindow,
                            Atom           xatom,
diff -Nru -x '*~' -x '*.o' -x '*.orig' -x '*.rej' metacity-2.4.34.orig/src/xprops.h metacity-2.4.34/src/xprops.h
--- metacity-2.4.34.orig/src/xprops.h	2002-12-16 17:01:15.000000000 -0500
+++ metacity-2.4.34/src/xprops.h	2003-03-06 11:45:34.000000000 -0500
@@ -77,6 +77,10 @@
                                       Window         xwindow,
                                       Atom           xatom,
                                       MotifWmHints **hints_p);
+gboolean meta_prop_get_save_id       (MetaDisplay   *display,
+                                      Window         xwindow,
+                                      Atom           xatom,
+				      char         **save_id);
 gboolean meta_prop_get_cardinal_list (MetaDisplay   *display,
                                       Window         xwindow,
                                       Atom           xatom,
