X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=tile.c;h=6a582822596d91b021cbbaf04b0885933db6f273;hb=3afca3e6a1457e93c9f7803dfcbc31f86b413095;hp=3cdaf49fea4e8d0ac8a242cd06b3862da78660d4;hpb=4246affc15dd378a33c58504b4abf3893b8c84cc;p=dwm.git diff --git a/tile.c b/tile.c index 3cdaf49..6a58282 100644 --- a/tile.c +++ b/tile.c @@ -1,20 +1,17 @@ /* See LICENSE file for copyright and license details. */ -double mfact = MFACT; int bx, by, bw, bh, blw, mx, my, mw, mh, tx, ty, tw, th, wx, wy, ww, wh; void setmfact(const char *arg); void tile(void); -void tilegeom(void); void tileresize(Client *c, int x, int y, int w, int h); +void updatetilegeom(void); void setmfact(const char *arg) { double d; - if(lt->arrange != tile) + if(!arg || lt->arrange != tile) return; - if(!arg) - mfact = MFACT; else { d = strtod(arg, NULL); if(arg[0] == '-' || arg[0] == '+') @@ -23,7 +20,7 @@ setmfact(const char *arg) { return; mfact = d; } - updategeom(); + updatetilegeom(); arrange(); } @@ -65,24 +62,9 @@ tile(void) { } void -tilegeom(void) { - /* master area geometry */ - mx = wx; - my = wy; - mw = mfact * ww; - mh = wh; - - /* tile area geometry */ - tx = mx + mw; - ty = wy; - tw = ww - mw; - th = wh; -} - -void tileresize(Client *c, int x, int y, int w, int h) { - resize(c, x, y, w, h, RESIZEHINTS); - if((RESIZEHINTS) && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w))) + resize(c, x, y, w, h, resizehints); + if(resizehints && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w))) /* client doesn't accept size constraints */ resize(c, x, y, w, h, False); } @@ -101,3 +83,18 @@ zoom(const char *arg) { } arrange(); } + +void +updatetilegeom(void) { + /* master area geometry */ + mx = wx; + my = wy; + mw = mfact * ww; + mh = wh; + + /* tile area geometry */ + tx = mx + mw; + ty = wy; + tw = ww - mw; + th = wh; +}