JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
applied viewsel.patch
[dwm.git] / tag.c
diff --git a/tag.c b/tag.c
index f6f4535..4b6d513 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -47,7 +47,9 @@ dofloat(Arg *arg)
                else
                        ban(c);
        }
-       if((sel = getnext(clients))) {
+       if(!sel || !isvisible(sel))
+               sel = getnext(clients);
+       if(sel) {
                focus(sel);
                restack();
        }
@@ -111,7 +113,9 @@ dotile(Arg *arg)
                else
                        ban(c);
        }
-       if((sel = getnext(clients)))
+       if(!sel || !isvisible(sel))
+               sel = getnext(clients);
+       if(sel)
                focus(sel);
        else
                XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime);
@@ -269,7 +273,8 @@ tag(Arg *arg)
                sel->tags[i] = False;
        sel->tags[arg->i] = True;
        settitle(sel);
-       arrange(NULL);
+       if(!isvisible(sel))
+               arrange(NULL);
 }
 
 void
@@ -292,6 +297,8 @@ toggletag(Arg *arg)
        if(i == ntags)
                sel->tags[arg->i] = True;
        settitle(sel);
+       if(!isvisible(sel))
+               arrange(NULL);
 }