Bool resizehints = True; /* False means respect size hints in tiled resizals */
Layout layouts[] = {
- /* symbol arrange geom */
- { "[]=", tile, updatetilegeom }, /* first entry is default */
- { "><>", NULL, NULL }, /* no layout function means floating behavior */
+ /* symbol arrange function */
+ { "[]=", tile }, /* first entry is default */
+ { "><>", NULL }, /* no layout function means floating behavior */
};
/* key definitions */
typedef struct {
const char *symbol;
void (*arrange)(void);
- void (*updategeom)(void);
} Layout;
typedef struct {
void updatebar(void);
void updategeom(void);
void updatesizehints(Client *c);
-void updatetilegeom(void);
void updatetitle(Client *c);
void updatewmhints(Client *c);
void view(const void *arg);
char stext[256];
int screen, sx, sy, sw, sh;
int bx, by, bw, bh, blw, wx, wy, ww, wh;
-int mx, my, mw, mh, tx, ty, tw, th;
uint seltags = 0;
int (*xerrorxlib)(Display *, XErrorEvent *);
uint numlockmask = 0;
if(d < 0.1 || d > 0.9)
return;
mfact = d;
- updatetilegeom();
arrange();
}
void
tile(void) {
- int x, y, h, w;
+ int x, y, h, w, mx, my, mw, mh, tx, ty, tw, th;
uint i, n;
Client *c;
if(n == 0)
return;
+ /* 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;
+
/* master */
c = nexttiled(clients);
bx = wx;
by = showbar ? (topbar ? wy - bh : wy + wh) : -bh;
bw = ww;
-
- /* update layout geometries */
- for(i = 0; i < LENGTH(layouts); i++)
- if(layouts[i].updategeom)
- layouts[i].updategeom();
}
void
&& c->maxw == c->minw && c->maxh == c->minh);
}
-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;
-}
-
void
updatetitle(Client *c) {
if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name))