diff options
author | Anselm R. Garbe <arg@10kloc.org> | 2006-09-06 11:54:16 +0200 |
---|---|---|
committer | Anselm R. Garbe <arg@10kloc.org> | 2006-09-06 11:54:16 +0200 |
commit | 69b738c097d8f471873a227e8668d8a35014be3d (patch) | |
tree | bce519f9e8c2abd2a221b4a5c461cbc7986187d7 /view.c | |
parent | da0b2a2f31d5a849464215a86a968ec3a1af2f73 (diff) | |
download | dwm-69b738c097d8f471873a227e8668d8a35014be3d.tar dwm-69b738c097d8f471873a227e8668d8a35014be3d.tar.gz dwm-69b738c097d8f471873a227e8668d8a35014be3d.tar.bz2 |
sanders solution is convincing and elegant
Diffstat (limited to 'view.c')
-rw-r--r-- | view.c | 50 |
1 files changed, 9 insertions, 41 deletions
@@ -215,52 +215,20 @@ resizecol(Arg *arg) void restack() { - static unsigned int nwins = 0; - static Window *wins = NULL; - unsigned int f, fi, m, mi, n; Client *c; XEvent ev; - - for(f = 0, m = 0, c = clients; c; c = c->next) - if(isvisible(c)) { - if(c->isfloat || arrange == dofloat) - f++; - else - m++; - } - if(!(n = 2 * (f + m))) { - drawstatus(); + + if(!sel) return; + if(sel->isfloat || arrange == dofloat) { + XRaiseWindow(dpy, sel->win); + XRaiseWindow(dpy, sel->twin); } - if(nwins < n) { - nwins = n; - wins = erealloc(wins, nwins * sizeof(Window)); - } - - fi = 0; - mi = 2 * f; - if(sel) { - if(sel->isfloat || arrange == dofloat) { - wins[fi++] = sel->twin; - wins[fi++] = sel->win; - } - else { - wins[mi++] = sel->twin; - wins[mi++] = sel->win; - } - } - for(c = clients; c; c = c->next) - if(isvisible(c) && c != sel) { - if(c->isfloat || arrange == dofloat) { - wins[fi++] = c->twin; - wins[fi++] = c->win; - } - else { - wins[mi++] = c->twin; - wins[mi++] = c->win; - } + if(arrange != dofloat) + for(c = nexttiled(clients); c; c = nexttiled(c->next)) { + XLowerWindow(dpy, c->twin); + XLowerWindow(dpy, c->win); } - XRestackWindows(dpy, wins, n); drawall(); XSync(dpy, False); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev)); |