X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=2f1e2b3b391e21c9f9d1f449d15dddcd41b41ed0;hb=d800ec05ff63451193a0b858c114f5144534c2a1;hp=33b3c564118d1ee61b4fb9bbda80653043de7434;hpb=28aba061ec2a6fa7923ea00b43e1335a27a73c06;p=dwm.git diff --git a/client.c b/client.c index 33b3c56..2f1e2b3 100644 --- a/client.c +++ b/client.c @@ -89,8 +89,6 @@ focus(Client *c) { if(!sel) sel = c; else if(sel != c) { - if(maximized) - togglemax(NULL); old = sel; sel = c; if(old) { @@ -208,6 +206,10 @@ manage(Window w, XWindowAttributes *wa) { c->w = c->tw = wa->width; c->h = wa->height; c->th = bh; + c->rx = sx; + c->ry = bh; + c->rw = sw; + c->rh = sh - bh; c->border = 0; updatesize(c); @@ -370,44 +372,10 @@ updatetitle(Client *c) { } void -togglemax(Arg *arg) { - int ox, oy, ow, oh; - Client *c; - XEvent ev; - - if(!sel) - return; - - if((maximized = !maximized)) { - ox = sel->x; - oy = sel->y; - ow = sel->w; - oh = sel->h; - sel->x = sx; - sel->y = sy + bh; - sel->w = sw - 2; - sel->h = sh - 2 - bh; - - restack(); - for(c = getnext(clients); c; c = getnext(c->next)) - if(c != sel) - ban(c); - resize(sel, arrange == dofloat, TopLeft); - - sel->x = ox; - sel->y = oy; - sel->w = ow; - sel->h = oh; - } - else - arrange(NULL); - while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); -} - -void unmanage(Client *c) { Client *nc; + /* The server grab construct avoids race conditions. */ XGrabServer(dpy); XSetErrorHandler(xerrordummy);