diff --git a/client.c b/client.c index 5a8c871f5..7e3d6dc5a 100644 --- a/client.c +++ b/client.c @@ -949,33 +949,35 @@ uicb_client_kill(int screen __attribute__ ((unused)), char *arg __attribute__ (( static void client_maximize(Client *c, area_t geometry) { - if((c->ismax = !c->ismax)) { + /* disable titlebar */ + c->titlebar.position = Off; c->wasfloating = c->isfloating; c->m_geometry = c->geometry; if(layout_get_current(c->screen)->arrange != layout_floating) client_setfloating(c, True); client_focus(c, c->screen, True); client_resize(c, geometry, False); - widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); + return; } else if(c->wasfloating) { + c->titlebar.position = c->titlebar.dposition; client_setfloating(c, True); client_resize(c, c->m_geometry, False); - widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); } else if(layout_get_current(c->screen)->arrange == layout_floating) { + c->titlebar.position = c->titlebar.dposition; client_resize(c, c->m_geometry, False); - widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); } else { + c->titlebar.position = c->titlebar.dposition; client_setfloating(c, False); - widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); } + widget_invalidate_cache(c->screen, WIDGET_CACHE_CLIENTS); } /** Toggle maximize for client diff --git a/ewmh.c b/ewmh.c index 5cc1a0dff..576f642f1 100644 --- a/ewmh.c +++ b/ewmh.c @@ -253,6 +253,8 @@ ewmh_process_state_atom(Client *c, Atom state, int set) { /* restore geometry */ geometry = c->m_geometry; + /* restore borders and titlebar */ + c->titlebar.position = c->titlebar.dposition; c->border = c->oldborder; c->ismax = False; client_setfloating(c, c->wasfloating); @@ -263,6 +265,8 @@ ewmh_process_state_atom(Client *c, Atom state, int set) /* save geometry */ c->m_geometry = c->geometry; c->wasfloating = c->isfloating; + /* disable titlebar and borders */ + c->titlebar.position = Off; c->oldborder = c->border; c->border = 0; c->ismax = True;