fix the ultimate bug when restarting awesome, client misdisplayed

This commit is contained in:
Julien Danjou 2007-09-19 00:03:54 +02:00
parent 1bb01589d5
commit a8a814110c
3 changed files with 5 additions and 7 deletions

View File

@ -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);

View File

@ -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;

View File

@ -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]);
}