JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
added some flicker prevention
[dwm.git] / client.c
index ecfd8f0..6a231b9 100644 (file)
--- a/client.c
+++ b/client.c
@@ -52,7 +52,6 @@ focus(Client *c)
        if (!issel)
                return;
        Client *old = sel;
-       XEvent ev;
 
        sel = c;
        if(old && old != c)
@@ -263,11 +262,13 @@ manage(Window w, XWindowAttributes *wa)
                                c->maxw == c->minw && c->maxh == c->minh);
        settitle(c);
 
+       if(isvisible(c))
+               sel = c;
+       arrange(NULL);
        XMapWindow(dpy, c->win);
        XMapWindow(dpy, c->title);
        if(isvisible(c))
                focus(c);
-       arrange(NULL);
 }
 
 void