Allow separate vertical & horizontal maximise to be true toggle switches. This makes one toggle then the other equivalent to normal full-size selection. It also makes it possible to set full size then unmaximize along one axis. Signed-Off-By: Darren Salt diff -urNad xfwm4-4.4.0~/src/client.c xfwm4-4.4.0/src/client.c --- xfwm4-4.4.0~/src/client.c 2007-02-03 19:00:02.000000000 +0000 +++ xfwm4-4.4.0/src/client.c 2007-02-03 19:00:11.566675819 +0000 @@ -2928,6 +2928,8 @@ clientSetNetState (c); } +static void clientNewMaxSize (Client *, XWindowChanges *); + static void clientNewMaxState (Client * c, XWindowChanges *wc, int mode) { @@ -2942,12 +2944,21 @@ if ((mode & WIN_STATE_MAXIMIZED) == WIN_STATE_MAXIMIZED) { - if (!FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED)) + if (FLAG_TEST (c->flags, CLIENT_FLAG_MAXIMIZED) != CLIENT_FLAG_MAXIMIZED) { c->win_state |= WIN_STATE_MAXIMIZED; FLAG_SET (c->flags, CLIENT_FLAG_MAXIMIZED); - return; } + else + { + c->win_state &= ~WIN_STATE_MAXIMIZED; + FLAG_UNSET (c->flags, CLIENT_FLAG_MAXIMIZED); + wc->x = c->old_x; + wc->y = c->old_y; + wc->width = c->old_width; + wc->height = c->old_height; + } + return; } if (mode & WIN_STATE_MAXIMIZED_HORIZ) @@ -2956,8 +2967,16 @@ { c->win_state |= WIN_STATE_MAXIMIZED_HORIZ; FLAG_SET (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ); - return; } + else + { + c->win_state &= ~WIN_STATE_MAXIMIZED_HORIZ; + FLAG_UNSET (c->flags, CLIENT_FLAG_MAXIMIZED_HORIZ); + c->x = wc->x = c->old_x; + c->width = wc->width = c->old_width; + clientNewMaxSize (c, wc); + } + return; } if (mode & WIN_STATE_MAXIMIZED_VERT) @@ -2966,16 +2985,18 @@ { c->win_state |= WIN_STATE_MAXIMIZED_VERT; FLAG_SET (c->flags, CLIENT_FLAG_MAXIMIZED_VERT); - return; } + else + { + c->win_state &= ~WIN_STATE_MAXIMIZED_VERT; + FLAG_UNSET (c->flags, CLIENT_FLAG_MAXIMIZED_VERT); + c->y = wc->y = c->old_y; + c->height = wc->height = c->old_height; + clientNewMaxSize (c, wc); + } + return; } - c->win_state &= ~WIN_STATE_MAXIMIZED; - FLAG_UNSET (c->flags, CLIENT_FLAG_MAXIMIZED); - wc->x = c->old_x; - wc->y = c->old_y; - wc->width = c->old_width; - wc->height = c->old_height; } static void