X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=client.c;h=85b1af82cbf008c66a9d3e7a1a3876a2bc0c8efc;hb=a54cf2ecef2ca83441dccd454c694b92bca42a16;hp=68d10a7333402f402fc317221f55120a4f4f9dd8;hpb=4b9337a01e7f12058ce54ed65d69e64748397498;p=dwm.git diff --git a/client.c b/client.c index 68d10a7..85b1af8 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,7 @@ manage(Window w, XWindowAttributes *wa) { c->isfloating = (rettrans == Success) || c->isfixed; attach(c); attachstack(c); - ban(c); - XMapWindow(dpy, w); - setclientstate(c, NormalState); + c->isbanned = True; focus(c); lt->arrange(); } @@ -308,9 +308,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; }