X-Git-Url: https://jasonwoof.com/gitweb/?p=dwm.git;a=blobdiff_plain;f=client.c;h=c6cf770cb2c86c4a6862592c5753ab283910273c;hp=114aeddc6328d0320593ab82dd198ece49f59ab7;hb=86953bd68249662b5d7a9ae6741744ab8bf30aa1;hpb=77044e876511f51c34bde379d89e2de754707ee6 diff --git a/client.c b/client.c index 114aedd..c6cf770 100644 --- a/client.c +++ b/client.c @@ -227,9 +227,7 @@ manage(Window w, XWindowAttributes *wa) { attach(c); attachstack(c); XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); /* some windows require this */ - setclientstate(c, IconicState); - c->isbanned = True; - focus(c); + ban(c); arrange(); } @@ -272,9 +270,9 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { w -= (w - c->basew) % c->incw; if(c->inch) h -= (h - c->baseh) % c->inch; - if(w <= 0 || h <= 0) - return; } + if(w <= 0 || h <= 0) + return; /* offscreen appearance fixes */ if(x > sw) x = sw - w - 2 * c->border; @@ -297,16 +295,6 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { } void -togglefloating(const char *arg) { - if(!sel || isfloating()) - return; - sel->isfloating = !sel->isfloating; - if(sel->isfloating) - resize(sel, sel->x, sel->y, sel->w, sel->h, True); - arrange(); -} - -void unban(Client *c) { if(!c->isbanned) return; @@ -316,7 +304,7 @@ unban(Client *c) { } void -unmanage(Client *c) { +unmanage(Client *c, long state) { XWindowChanges wc; wc.border_width = c->oldborder; @@ -329,13 +317,14 @@ unmanage(Client *c) { if(sel == c) focus(NULL); XUngrabButton(dpy, AnyButton, AnyModifier, c->win); - setclientstate(c, WithdrawnState); + setclientstate(c, state); free(c->tags); free(c); XSync(dpy, False); XSetErrorHandler(xerror); XUngrabServer(dpy); - arrange(); + if(state != NormalState) + arrange(); } void