mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
if we maximize after placement, and the window is too big to fix in the
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.
This commit is contained in:
@ -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 */
|
||||
|
Reference in New Issue
Block a user