X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=view.c;h=3e786613502b16b5822ba68502c82f0759a27cad;hb=438beeabde5e56f8d85e0dd143721e9372e3eab4;hp=9ee4c7898e0b9702588262b3ab665215122caa9c;hpb=d22abeee867397c366f69cf89524b94e01c2e0e2;p=dwm.git diff --git a/view.c b/view.c index 9ee4c78..3e78661 100644 --- a/view.c +++ b/view.c @@ -76,8 +76,10 @@ dofloat(Arg *arg) else ban(c); } - if(!sel || !isvisible(sel)) - focus(getnext(clients)); + if(!sel || !isvisible(sel)) { + for(c = stack; c && !isvisible(c); c = c->snext); + focus(c); + } restack(); } @@ -138,8 +140,10 @@ dotile(Arg *arg) else ban(c); } - if(!sel || !isvisible(sel)) - focus(getnext(clients)); + if(!sel || !isvisible(sel)) { + for(c = stack; c && !isvisible(c); c = c->snext); + focus(c); + } restack(); } @@ -227,7 +231,7 @@ restack() XRaiseWindow(dpy, sel->win); XRaiseWindow(dpy, sel->twin); } - if(arrange != dofloat) + if(arrange != dofloat) for(c = nexttiled(clients); c; c = nexttiled(c->next)) { XLowerWindow(dpy, c->twin); XLowerWindow(dpy, c->win);