Index: src/window.c
===================================================================
RCS file: /cvs/gnome/metacity/src/window.c,v
retrieving revision 1.388
diff -p -u -r1.388 window.c
--- src/window.c	2 Jun 2005 15:47:37 -0000	1.388
+++ src/window.c	12 Jul 2005 19:10:46 -0000
@@ -964,6 +964,9 @@ meta_window_free (MetaWindow  *window)
   meta_window_unqueue_update_icon (window);
   meta_window_free_delete_dialog (window);
   
+  if (window->maximized)
+    meta_window_unmaximize (window);
+  
   if (window->workspace)
     meta_workspace_remove_window (window->workspace, window);
 
@@ -983,8 +986,6 @@ meta_window_free (MetaWindow  *window)
 #endif
   
   meta_stack_remove (window->screen->stack, window);
-  
-  /* FIXME restore original size if window has maximized */
   
   if (window->frame)
     meta_window_destroy_frame (window);
