X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=view.c;h=5cbab0866fc5c8366ffd3597b8ea5e7a6a7a19a5;hb=15abade2720158fd35dcf59aa2cd5cbb325a849c;hp=3b5abbaa843113992ffb518610a520f284751536;hpb=69b738c097d8f471873a227e8668d8a35014be3d;p=dwm.git diff --git a/view.c b/view.c index 3b5abba..5cbab08 100644 --- a/view.c +++ b/view.c @@ -12,13 +12,14 @@ minclient() { Client *c, *min; + if((clients && clients->isfloat) || arrange == dofloat) + return clients; /* don't touch floating order */ for(min = c = clients; c; c = c->next) if(c->weight < min->weight) min = c; return min; } - static void reorder() { @@ -75,8 +76,10 @@ dofloat(Arg *arg) else ban(c); } - if(!sel || !isvisible(sel)) - focus(getnext(clients)); + if(!sel || !isvisible(sel)) { + for(sel = stack; sel && !isvisible(sel); sel = sel->snext); + focus(sel); + } restack(); } @@ -137,8 +140,10 @@ dotile(Arg *arg) else ban(c); } - if(!sel || !isvisible(sel)) - focus(getnext(clients)); + if(!sel || !isvisible(sel)) { + for(sel = stack; sel && !isvisible(sel); sel = sel->snext); + focus(sel); + } restack(); } @@ -218,13 +223,15 @@ restack() Client *c; XEvent ev; - if(!sel) + if(!sel) { + drawstatus(); return; + } if(sel->isfloat || arrange == dofloat) { 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); @@ -296,8 +303,9 @@ zoom(Arg *arg) if(!(c = nexttiled(c->next))) return; detach(c); + if(clients) + clients->prev = c; c->next = clients; - clients->prev = c; clients = c; focus(c); arrange(NULL);