X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=tag.c;h=cdb0f5242e5438ae29a6d1fa24e2ffe723a68274;hb=b5c2412d848011ebf0f29c73d4ca01f52006990c;hp=a718ebd2cd55a76710b10dda71c3f00f8e7b81d4;hpb=78b050c13c8ea660ed801c21bddd2957a2bc3f40;p=dwm.git diff --git a/tag.c b/tag.c index a718ebd..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); @@ -277,7 +280,10 @@ void togglemode(Arg *arg) { arrange = arrange == dofloat ? dotile : dofloat; - arrange(NULL); + if(sel) + arrange(NULL); + else + drawstatus(); } void