diff -r -u metacity-2.8.1/src/display.c metacity-2.8.1-new/src/display.c
--- metacity-2.8.1/src/display.c	2004-09-10 16:49:03.767201142 -0400
+++ metacity-2.8.1-new/src/display.c	2004-09-10 16:39:15.547442031 -0400
@@ -281,6 +281,7 @@
     "_NET_WM_ACTION_MINIMIZE",
     "_NET_FRAME_EXTENTS",
     "_NET_REQUEST_FRAME_EXTENTS",
+    "_NET_WM_GEOMETRY_SAVE_ID"
   };
   Atom atoms[G_N_ELEMENTS(atom_names)];
   
@@ -427,6 +428,7 @@
   display->atom_net_wm_action_minimize = atoms[82];
   display->atom_net_frame_extents = atoms[83];
   display->atom_net_request_frame_extents = atoms[84];
+  display->atom_net_wm_geometry_save_id = atoms[85];
 
   display->prop_hooks = NULL;
   meta_display_init_window_prop_hooks (display);
diff -r -u metacity-2.8.1/src/display.h metacity-2.8.1-new/src/display.h
--- metacity-2.8.1/src/display.h	2004-04-14 14:58:07.000000000 -0400
+++ metacity-2.8.1-new/src/display.h	2004-09-10 16:39:41.767992456 -0400
@@ -175,6 +175,7 @@
   Atom atom_net_wm_strut_partial;
   Atom atom_net_frame_extents;
   Atom atom_net_request_frame_extents;
+  Atom atom_net_wm_geometry_save_id;
 
   /* This is the actual window from focus events,
    * not the one we last set
diff -r -u metacity-2.8.1/src/screen.c metacity-2.8.1-new/src/screen.c
--- metacity-2.8.1/src/screen.c	2004-04-14 14:58:07.000000000 -0400
+++ metacity-2.8.1-new/src/screen.c	2004-09-10 16:40:48.731180567 -0400
@@ -82,7 +82,7 @@
 static int
 set_supported_hint (MetaScreen *screen)
 {
-#define N_SUPPORTED 54
+#define N_SUPPORTED 55
   Atom atoms[N_SUPPORTED];
   
   atoms[0] = screen->display->atom_net_wm_name;
@@ -139,6 +139,7 @@
   atoms[51] = screen->display->atom_net_wm_action_minimize;
   atoms[52] = screen->display->atom_net_frame_extents;
   atoms[53] = screen->display->atom_net_request_frame_extents;
+  atoms[54] = screen->display->atom_net_wm_geometry_save_id;
   
   XChangeProperty (screen->display->xdisplay, screen->xroot,
                    screen->display->atom_net_supported,
diff -r -u metacity-2.8.1/src/xprops.c metacity-2.8.1-new/src/xprops.c
--- metacity-2.8.1/src/xprops.c	2003-09-29 14:16:45.000000000 -0400
+++ metacity-2.8.1-new/src/xprops.c	2004-09-10 16:44:38.979989539 -0400
@@ -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 Geometry Save ID wasn't set on this window.\n");
+      return FALSE;
+    }
+  if (results.type == None || results.n_items <= 0)
+    {
+      meta_verbose ("History Geometry 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 -r -u metacity-2.8.1/src/xprops.h metacity-2.8.1-new/src/xprops.h
--- metacity-2.8.1/src/xprops.h	2002-12-16 17:01:15.000000000 -0500
+++ metacity-2.8.1-new/src/xprops.h	2004-09-10 16:44:01.904854299 -0400
@@ -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,
