X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=tag.c;h=cdb0f5242e5438ae29a6d1fa24e2ffe723a68274;hb=ad2e77d6350b1f43513d052018735d2a8f949d78;hp=f6f4535a4fce7793ded49099ee67238edb2930e1;hpb=57e6e3bb80b5fc4709de3f8b716a8b8065897c7a;p=dwm.git diff --git a/tag.c b/tag.c index f6f4535..cdb0f52 100644 --- a/tag.c +++ b/tag.c @@ -47,12 +47,13 @@ dofloat(Arg *arg) else ban(c); } - if((sel = getnext(clients))) { + if(!sel || !isvisible(sel)) + sel = getnext(clients); + if(sel) focus(sel); - restack(); - } else XSetInputFocus(dpy, root, RevertToPointerRoot, CurrentTime); + restack(); } void @@ -111,7 +112,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,14 +272,18 @@ tag(Arg *arg) sel->tags[i] = False; sel->tags[arg->i] = True; settitle(sel); - arrange(NULL); + if(!isvisible(sel)) + arrange(NULL); } void togglemode(Arg *arg) { arrange = arrange == dofloat ? dotile : dofloat; - arrange(NULL); + if(sel) + arrange(NULL); + else + drawstatus(); } void @@ -292,6 +299,8 @@ toggletag(Arg *arg) if(i == ntags) sel->tags[arg->i] = True; settitle(sel); + if(!isvisible(sel)) + arrange(NULL); }