tile.c
changeset 1209 c2dc0bd92158
parent 1206 2914cb30c2d4
child 1210 225aa5566f0e
equal deleted inserted replaced
1208:fab49062da0a 1209:c2dc0bd92158
     1 /* See LICENSE file for copyright and license details. */
     1 /* See LICENSE file for copyright and license details. */
     2 double mfact = MFACT;
       
     3 int bx, by, bw, bh, blw, mx, my, mw, mh, tx, ty, tw, th, wx, wy, ww, wh;
     2 int bx, by, bw, bh, blw, mx, my, mw, mh, tx, ty, tw, th, wx, wy, ww, wh;
     4 
     3 
     5 void setmfact(const char *arg);
     4 void setmfact(const char *arg);
     6 void tile(void);
     5 void tile(void);
     7 void tileresize(Client *c, int x, int y, int w, int h);
     6 void tileresize(Client *c, int x, int y, int w, int h);
     9 
     8 
    10 void
     9 void
    11 setmfact(const char *arg) {
    10 setmfact(const char *arg) {
    12 	double d;
    11 	double d;
    13 
    12 
    14 	if(lt->arrange != tile)
    13 	if(!arg || lt->arrange != tile)
    15 		return;
    14 		return;
    16 	if(!arg)
       
    17 		mfact = MFACT;
       
    18 	else {
    15 	else {
    19 		d = strtod(arg, NULL);
    16 		d = strtod(arg, NULL);
    20 		if(arg[0] == '-' || arg[0] == '+')
    17 		if(arg[0] == '-' || arg[0] == '+')
    21 			d += mfact;
    18 			d += mfact;
    22 		if(d < 0.1 || d > 0.9)
    19 		if(d < 0.1 || d > 0.9)
    64 	}
    61 	}
    65 }
    62 }
    66 
    63 
    67 void
    64 void
    68 tileresize(Client *c, int x, int y, int w, int h) {
    65 tileresize(Client *c, int x, int y, int w, int h) {
    69 	resize(c, x, y, w, h, RESIZEHINTS);
    66 	resize(c, x, y, w, h, resizehints);
    70 	if((RESIZEHINTS) && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w)))
    67 	if(resizehints && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w)))
    71 		/* client doesn't accept size constraints */
    68 		/* client doesn't accept size constraints */
    72 		resize(c, x, y, w, h, False);
    69 		resize(c, x, y, w, h, False);
    73 }
    70 }
    74 
    71 
    75 void
    72 void
    87 	arrange();
    84 	arrange();
    88 }
    85 }
    89 
    86 
    90 void
    87 void
    91 updatetilegeom(void) {
    88 updatetilegeom(void) {
       
    89 #ifdef TILEGEOM /* define your own if you are Xinerama user */
       
    90 	TILEGEOM
       
    91 #else
    92 	/* master area geometry */
    92 	/* master area geometry */
    93 	mx = wx;
    93 	mx = wx;
    94 	my = wy;
    94 	my = wy;
    95 	mw = mfact * ww;
    95 	mw = mfact * ww;
    96 	mh = wh;
    96 	mh = wh;
    98 	/* tile area geometry */
    98 	/* tile area geometry */
    99 	tx = mx + mw;
    99 	tx = mx + mw;
   100 	ty = wy;
   100 	ty = wy;
   101 	tw = ww - mw;
   101 	tw = ww - mw;
   102 	th = wh;
   102 	th = wh;
       
   103 #endif
   103 }
   104 }