X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=client.c;h=d4dfe6e6806b7735df9f599cab784fa9652ecbe1;hp=68d10a7333402f402fc317221f55120a4f4f9dd8;hb=2d81b78b853565a3e34a8a9190e2362a6fdde739;hpb=83aa110c6fabbf5f5a14b698a6ca22072cb80629 diff --git a/client.c b/client.c index 68d10a7..d4dfe6e 100644 --- a/client.c +++ b/client.c @@ -98,10 +98,12 @@ attach(Client *c) { void ban(Client *c) { - if (c->isbanned) + if(c->isbanned) return; - XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); + XUnmapWindow(dpy, c->win); + setclientstate(c, IconicState); c->isbanned = True; + c->unmapped++; } void @@ -135,7 +137,7 @@ detach(Client *c) { void focus(Client *c) { - if((!c && selscreen)|| (c && !isvisible(c))) + if((!c && selscreen) || (c && !isvisible(c))) for(c = stack; c && !isvisible(c); c = c->snext); if(sel && sel != c) { grabbuttons(sel, False); @@ -224,9 +226,9 @@ manage(Window w, XWindowAttributes *wa) { c->isfloating = (rettrans == Success) || c->isfixed; attach(c); attachstack(c); - ban(c); - XMapWindow(dpy, w); - setclientstate(c, NormalState); + XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */ + setclientstate(c, IconicState); + c->isbanned = True; focus(c); lt->arrange(); } @@ -308,9 +310,10 @@ togglefloating(const char *arg) { void unban(Client *c) { - if (!c->isbanned) + if(!c->isbanned) return; - XMoveWindow(dpy, c->win, c->x, c->y); + XMapWindow(dpy, c->win); + setclientstate(c, NormalState); c->isbanned = False; }