From 3df5a50fc477ad1e0421c5113a8602292463d40d Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 23 Apr 2008 14:25:40 +0200 Subject: [PATCH] [titlebar] Fix unmap/map handling Signed-off-by: Julien Danjou --- titlebar.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/titlebar.c b/titlebar.c index f46f45938..1be0e4a61 100644 --- a/titlebar.c +++ b/titlebar.c @@ -71,6 +71,7 @@ titlebar_init(Client *c) default: break; } + XMapWindow(globalconf.display, c->titlebar.sw->window); } /** Add the titlebar geometry to a geometry. @@ -231,7 +232,6 @@ titlebar_update_geometry_floating(Client *c) default: return; case Off: - XUnmapWindow(globalconf.display, c->titlebar.sw->window); return; case Top: if(!c->titlebar.width) @@ -323,7 +323,6 @@ titlebar_update_geometry_floating(Client *c) break; } - XMapWindow(globalconf.display, c->titlebar.sw->window); titlebar_draw(c); } @@ -345,7 +344,6 @@ titlebar_update_geometry(Client *c, area_t geometry) default: return; case Off: - XUnmapWindow(globalconf.display, c->titlebar.sw->window); return; case Top: if(!c->titlebar.width) @@ -439,7 +437,6 @@ titlebar_update_geometry(Client *c, area_t geometry) break; } - XMapWindow(globalconf.display, c->titlebar.sw->window); titlebar_draw(c); } @@ -457,9 +454,15 @@ uicb_client_toggletitlebar(int screen __attribute__ ((unused)), char *arg __attr return; if(!c->titlebar.position) - c->titlebar.position = c->titlebar.dposition; + { + if((c->titlebar.position = c->titlebar.dposition)) + XMapWindow(globalconf.display, c->titlebar.sw->window); + } else + { c->titlebar.position = Off; + XUnmapWindow(globalconf.display, c->titlebar.sw->window); + } if(c->isfloating || layout_get_current(screen)->arrange == layout_floating) titlebar_update_geometry_floating(c);