X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=client.c;h=166e9796cd25806e805f60980b24d6cd30214a97;hb=4f8b08d330a6c377ab919f48b8e922d1c5ded601;hp=158b92833158df13de27ef9d287976fd919ed3a5;hpb=e6cbe9c11e88537d74eb094ba5844f71ee57f268;p=dwm.git diff --git a/client.c b/client.c index 158b928..166e979 100644 --- a/client.c +++ b/client.c @@ -66,8 +66,8 @@ focusnext(Arg *arg) if(!sel) return; - if(!(c = getnext(sel->next))) - c = getnext(clients); + if(!(c = getnext(sel->next, tsel))) + c = getnext(clients, tsel); if(c) { higher(c); c->revert = sel; @@ -192,7 +192,7 @@ lower(Client *c) void manage(Window w, XWindowAttributes *wa) { - Client *c, **l; + Client *c; XSetWindowAttributes twa; Window trans; @@ -223,10 +223,11 @@ manage(Window w, XWindowAttributes *wa) settitle(c); settags(c); - for(l = &clients; *l; l = &(*l)->next); - c->next = *l; /* *l == nil */ - *l = c; + c->next = clients; + clients = c; + XGrabButton(dpy, Button1, ControlMask, c->win, False, ButtonPressMask, + GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button1, Mod1Mask, c->win, False, ButtonPressMask, GrabModeAsync, GrabModeSync, None, None); XGrabButton(dpy, Button2, Mod1Mask, c->win, False, ButtonPressMask, @@ -234,8 +235,8 @@ manage(Window w, XWindowAttributes *wa) XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, GrabModeAsync, GrabModeSync, None, None); - if(!c->dofloat) - c->dofloat = trans + if(!c->isfloat) + c->isfloat = trans || ((c->maxw == c->minw) && (c->maxh == c->minh)); arrange(NULL); @@ -249,6 +250,7 @@ manage(Window w, XWindowAttributes *wa) ban(c); XMapRaised(dpy, c->win); XMapRaised(dpy, c->title); + XSync(dpy, False); } } @@ -408,8 +410,8 @@ zoom(Arg *arg) if(!sel) return; - if(sel == getnext(clients) && sel->next) { - if((c = getnext(sel->next))) + if(sel == getnext(clients, tsel) && sel->next) { + if((c = getnext(sel->next, tsel))) sel = c; }