X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=tag.c;h=cdb0f5242e5438ae29a6d1fa24e2ffe723a68274;hb=a420ceab50b896a6b6edc81c2a42c4ddc75b867e;hp=51407e3e3712201a44c87ebd62281cd4e4a22d35;hpb=19da197f58bc005ad379d751f28f0a17cea3d3b8;p=dwm.git diff --git a/tag.c b/tag.c index 51407e3..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,13 +272,18 @@ tag(Arg *arg) sel->tags[i] = False; sel->tags[arg->i] = True; settitle(sel); + if(!isvisible(sel)) + arrange(NULL); } void togglemode(Arg *arg) { arrange = arrange == dofloat ? dotile : dofloat; - arrange(NULL); + if(sel) + arrange(NULL); + else + drawstatus(); } void @@ -291,6 +299,8 @@ toggletag(Arg *arg) if(i == ntags) sel->tags[arg->i] = True; settitle(sel); + if(!isvisible(sel)) + arrange(NULL); }