Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/metacity/ChangeLog,v
retrieving revision 1.785
diff -p -u -r1.785 ChangeLog
--- ChangeLog	10 Jan 2004 17:16:02 -0000	1.785
+++ ChangeLog	10 Jan 2004 18:09:22 -0000
@@ -1,3 +1,12 @@
+2004-01-12  Rob Adams  <readams@readams.net>
+
+	* src/constraints.c (meta_window_constrain): if we maximize after
+	placement, and the window is too big to fix in the work area,
+	define a sane saved_rect approximately with dimensions
+	three-quarters approximately three quarters the size of the work
+	area.  This avoids the problem where large windows would
+	unmaximize and actually get bigger.  See #93590.
+
 2004-01-09  Thomas Fitzsimmons  <fitzsim@redhat.com>
 
 	Add _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS.
Index: src/constraints.c
===================================================================
RCS file: /cvs/gnome/metacity/src/constraints.c,v
retrieving revision 1.19
diff -p -u -r1.19 constraints.c
--- src/constraints.c	7 Oct 2003 02:08:45 -0000	1.19
+++ src/constraints.c	10 Jan 2004 18:09:34 -0000
@@ -1319,6 +1319,19 @@ meta_window_constrain (MetaWindow       
       (window->placed || did_placement))
     {
       window->maximize_after_placement = FALSE;
+
+      if (OUTER_WIDTH (*new) >= info.work_area_xinerama.width &&
+	  OUTER_HEIGHT (*new) >= info.work_area_xinerama.height)
+	{
+	  /* define a sane saved_rect so that the user can unmaximize
+	   * to something reasonable.
+	   */
+	  new->width = .75 * info.work_area_xinerama.width;
+	  new->height = .75 * info.work_area_xinerama.height;
+	  new->x = info.work_area_xinerama.x + .125 * info.work_area_xinerama.width;
+	  new->y = info.work_area_xinerama.y + .083 * info.work_area_xinerama.height;
+	}
+
       meta_window_maximize_internal (window, new);
 
       /* maximization may have changed frame geometry */
