diff --git a/ChangeLog b/ChangeLog index 7e9e95dae..e6929b289 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-01-12 Rob Adams + + * 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 Add _NET_FRAME_EXTENTS and _NET_REQUEST_FRAME_EXTENTS. diff --git a/src/constraints.c b/src/constraints.c index 06bddb511..372a2e45d 100644 --- a/src/constraints.c +++ b/src/constraints.c @@ -1319,6 +1319,19 @@ meta_window_constrain (MetaWindow *window, (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 */