From ba7f151d0d5f3a80350569b85419f9a92c56cae2 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan <fourdan.olivier@wanadoo.fr> Date: Sun, 12 Feb 2006 22:15:38 +0000 Subject: [PATCH] Use smarter maximization that takes partial struts into account even among the same monitor. (Old svn revision: 19851) --- src/client.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/client.c b/src/client.c index 7c0c95ab7..9378d64e7 100644 --- a/src/client.c +++ b/src/client.c @@ -2753,12 +2753,30 @@ clientToggleMaximized (Client * c, int mode, gboolean restore_position) full_h = MIN (gdk_screen_get_height (screen_info->gscr) - screen_info->params->xfwm_margins[BOTTOM], rect.y + rect.height) - full_y; - if (((mode & WIN_STATE_MAXIMIZED_HORIZ) && !FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ)) || + if (((mode & WIN_STATE_MAXIMIZED_HORIZ) && !FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ)) && ((mode & WIN_STATE_MAXIMIZED_VERT) && !FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_VERT))) { - /* Adjust size to the widest size available, not covering struts */ + /* Adjust size to the largest size available, not covering struts */ clientMaxSpace (screen_info, &full_x, &full_y, &full_w, &full_h); } + else if ((mode & WIN_STATE_MAXIMIZED_HORIZ) && !FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ)) + { + int tmp_y, tmp_h; + + tmp_y = frameY (c); + tmp_h = frameHeight (c); + /* Adjust size to the widest size available, for the current vertical position/height */ + clientMaxSpace (screen_info, &full_x, &tmp_y, &full_w, &tmp_h); + } + else if ((mode & WIN_STATE_MAXIMIZED_VERT) && !FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED_VERT)) + { + int tmp_x, tmp_w; + + tmp_x = frameX (c); + tmp_w = frameWidth (c); + /* Adjust size to the tallest size available, for the current horizontal position/width */ + clientMaxSpace (screen_info, &tmp_x, &full_y, &tmp_w, &full_h); + } if (mode & WIN_STATE_MAXIMIZED_HORIZ) { @@ -4402,4 +4420,3 @@ clientGetStartupId (Client * c) return (c->startup_id); } #endif /* HAVE_LIBSTARTUP_NOTIFICATION */ - -- GitLab