JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
removed VRATIO, NMASTER, inc*(), renamed HRATIO into MASTER, see mailinglist for...
[dwm.git] / client.c
index 68d10a7..08fe1bd 100644 (file)
--- 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,11 +226,11 @@ 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();
+       lt->arrange(NULL);
 }
 
 void
@@ -303,14 +305,15 @@ togglefloating(const char *arg) {
        sel->isfloating = !sel->isfloating;
        if(sel->isfloating)
                resize(sel, sel->x, sel->y, sel->w, sel->h, True);
-       lt->arrange();
+       lt->arrange(NULL);
 }
 
 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;
 }
 
@@ -334,7 +337,7 @@ unmanage(Client *c) {
        XSync(dpy, False);
        XSetErrorHandler(xerror);
        XUngrabServer(dpy);
-       lt->arrange();
+       lt->arrange(NULL);
 }
 
 void