From a8a814110c66efe75981efcd36114040e3bb633e Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 19 Sep 2007 00:03:54 +0200 Subject: [PATCH] fix the ultimate bug when restarting awesome, client misdisplayed --- client.c | 8 +++----- client.h | 2 +- event.c | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/client.c b/client.c index ff7763df..9cdfcde1 100644 --- a/client.c +++ b/client.c @@ -207,12 +207,10 @@ updatetitle(Client * c) void ban(Client * c) { - if(c->isbanned) - return; XUnmapWindow(c->display, c->win); setclientstate(c, IconicState); c->isbanned = True; - c->unmapped++; + c->unmapped = True; } /** Configure client @@ -550,11 +548,10 @@ saveprops(Client * c, int ntags) void unban(Client * c) { - if(!c->isbanned) - return; XMapWindow(c->display, c->win); setclientstate(c, NormalState); c->isbanned = False; + c->unmapped = False; } void @@ -562,6 +559,7 @@ unmanage(Client * c, DC *drawcontext, long state, awesome_config *awesomeconf) { XWindowChanges wc; + c->unmapped = True; wc.border_width = c->oldborder; /* The server grab construct avoids race conditions. */ XGrabServer(c->display); diff --git a/client.h b/client.h index 29e8005f..b2f3b710 100644 --- a/client.h +++ b/client.h @@ -38,7 +38,7 @@ struct Client int rx, ry, rw, rh; int basew, baseh, incw, inch, maxw, maxh, minw, minh; int minax, maxax, minay, maxay; - int unmapped; + Bool unmapped; long flags; int border, oldborder; Bool isbanned, isfixed, ismax, isfloating, wasfloating; diff --git a/event.c b/event.c index 4dc8b7aa..567bdf9f 100644 --- a/event.c +++ b/event.c @@ -429,7 +429,7 @@ handle_event_unmapnotify(XEvent * e, awesome_config *awesomeconf) XUnmapEvent *ev = &e->xunmap; if((c = getclient(ev->window)) - && ev->event == RootWindow(e->xany.display, c->screen) && (ev->send_event || !c->unmapped--)) + && ev->event == RootWindow(e->xany.display, c->screen) && (ev->send_event || !c->unmapped)) unmanage(c, &dc[c->screen], WithdrawnState, &awesomeconf[c->screen]); }