tile.c
changeset 1206 2914cb30c2d4
parent 1203 710f0fc31764
child 1209 c2dc0bd92158
equal deleted inserted replaced
1205:84f98bdf8fbe 1206:2914cb30c2d4
     2 double mfact = MFACT;
     2 double mfact = MFACT;
     3 int bx, by, bw, bh, blw, mx, my, mw, mh, tx, ty, tw, th, wx, wy, ww, wh;
     3 int bx, by, bw, bh, blw, mx, my, mw, mh, tx, ty, tw, th, wx, wy, ww, wh;
     4 
     4 
     5 void setmfact(const char *arg);
     5 void setmfact(const char *arg);
     6 void tile(void);
     6 void tile(void);
     7 void tilegeom(void);
       
     8 void tileresize(Client *c, int x, int y, int w, int h);
     7 void tileresize(Client *c, int x, int y, int w, int h);
       
     8 void updatetilegeom(void);
     9 
     9 
    10 void
    10 void
    11 setmfact(const char *arg) {
    11 setmfact(const char *arg) {
    12 	double d;
    12 	double d;
    13 
    13 
    63 			y = c->y + c->h + 2 * c->bw;
    63 			y = c->y + c->h + 2 * c->bw;
    64 	}
    64 	}
    65 }
    65 }
    66 
    66 
    67 void
    67 void
    68 tilegeom(void) {
       
    69 	/* master area geometry */
       
    70 	mx = wx;
       
    71 	my = wy;
       
    72 	mw = mfact * ww;
       
    73 	mh = wh;
       
    74 
       
    75 	/* tile area geometry */
       
    76 	tx = mx + mw;
       
    77 	ty = wy;
       
    78 	tw = ww - mw;
       
    79 	th = wh;
       
    80 }
       
    81 
       
    82 void
       
    83 tileresize(Client *c, int x, int y, int w, int h) {
    68 tileresize(Client *c, int x, int y, int w, int h) {
    84 	resize(c, x, y, w, h, RESIZEHINTS);
    69 	resize(c, x, y, w, h, RESIZEHINTS);
    85 	if((RESIZEHINTS) && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w)))
    70 	if((RESIZEHINTS) && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w)))
    86 		/* client doesn't accept size constraints */
    71 		/* client doesn't accept size constraints */
    87 		resize(c, x, y, w, h, False);
    72 		resize(c, x, y, w, h, False);
    99 		attach(c);
    84 		attach(c);
   100 		focus(c);
    85 		focus(c);
   101 	}
    86 	}
   102 	arrange();
    87 	arrange();
   103 }
    88 }
       
    89 
       
    90 void
       
    91 updatetilegeom(void) {
       
    92 	/* master area geometry */
       
    93 	mx = wx;
       
    94 	my = wy;
       
    95 	mw = mfact * ww;
       
    96 	mh = wh;
       
    97 
       
    98 	/* tile area geometry */
       
    99 	tx = mx + mw;
       
   100 	ty = wy;
       
   101 	tw = ww - mw;
       
   102 	th = wh;
       
   103 }