X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=view.c;h=3e786613502b16b5822ba68502c82f0759a27cad;hb=6ff346bed992971f508102b5f0b9cf34038a2c08;hp=eddf2dadc0baf79da8afe0ff46a244efc3fbebe5;hpb=a33150eb4b041b243d0493cd4b53bfbcace3299e;p=dwm.git diff --git a/view.c b/view.c index eddf2da..3e78661 100644 --- a/view.c +++ b/view.c @@ -12,6 +12,8 @@ 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; @@ -19,16 +21,6 @@ minclient() } static void -pop(Client *c) -{ - detach(c); - if(clients) - clients->prev = c; - c->next = clients; - clients = c; -} - -static void reorder() { Client *c, *newclients, *tail; @@ -84,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(); } @@ -146,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(); } @@ -232,11 +228,10 @@ restack() return; } if(sel->isfloat || arrange == dofloat) { - pop(sel); 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); @@ -307,7 +302,11 @@ zoom(Arg *arg) if((c = sel) == nexttiled(clients)) if(!(c = nexttiled(c->next))) return; - pop(c); + detach(c); + if(clients) + clients->prev = c; + c->next = clients; + clients = c; focus(c); arrange(NULL); }