summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.def.h6
-rw-r--r--dwm.c38
2 files changed, 16 insertions, 28 deletions
diff --git a/config.def.h b/config.def.h
index ba45347..5154405 100644
--- a/config.def.h
+++ b/config.def.h
@@ -27,9 +27,9 @@ double mfact = 0.55;
27Bool resizehints = True; /* False means respect size hints in tiled resizals */ 27Bool resizehints = True; /* False means respect size hints in tiled resizals */
28 28
29Layout layouts[] = { 29Layout layouts[] = {
30 /* symbol arrange geom */ 30 /* symbol arrange function */
31 { "[]=", tile, updatetilegeom }, /* first entry is default */ 31 { "[]=", tile }, /* first entry is default */
32 { "><>", NULL, NULL }, /* no layout function means floating behavior */ 32 { "><>", NULL }, /* no layout function means floating behavior */
33}; 33};
34 34
35/* key definitions */ 35/* key definitions */
diff --git a/dwm.c b/dwm.c
index b61bbf5..0e4703e 100644
--- a/dwm.c
+++ b/dwm.c
@@ -105,7 +105,6 @@ typedef struct {
105typedef struct { 105typedef struct {
106 const char *symbol; 106 const char *symbol;
107 void (*arrange)(void); 107 void (*arrange)(void);
108 void (*updategeom)(void);
109} Layout; 108} Layout;
110 109
111typedef struct { 110typedef struct {
@@ -183,7 +182,6 @@ void unmapnotify(XEvent *e);
183void updatebar(void); 182void updatebar(void);
184void updategeom(void); 183void updategeom(void);
185void updatesizehints(Client *c); 184void updatesizehints(Client *c);
186void updatetilegeom(void);
187void updatetitle(Client *c); 185void updatetitle(Client *c);
188void updatewmhints(Client *c); 186void updatewmhints(Client *c);
189void view(const void *arg); 187void view(const void *arg);
@@ -197,7 +195,6 @@ void zoom(const void *arg);
197char stext[256]; 195char stext[256];
198int screen, sx, sy, sw, sh; 196int screen, sx, sy, sw, sh;
199int bx, by, bw, bh, blw, wx, wy, ww, wh; 197int bx, by, bw, bh, blw, wx, wy, ww, wh;
200int mx, my, mw, mh, tx, ty, tw, th;
201uint seltags = 0; 198uint seltags = 0;
202int (*xerrorxlib)(Display *, XErrorEvent *); 199int (*xerrorxlib)(Display *, XErrorEvent *);
203uint numlockmask = 0; 200uint numlockmask = 0;
@@ -1315,7 +1312,6 @@ setmfact(const void *arg) {
1315 if(d < 0.1 || d > 0.9) 1312 if(d < 0.1 || d > 0.9)
1316 return; 1313 return;
1317 mfact = d; 1314 mfact = d;
1318 updatetilegeom();
1319 arrange(); 1315 arrange();
1320} 1316}
1321 1317
@@ -1439,7 +1435,7 @@ textnw(const char *text, uint len) {
1439 1435
1440void 1436void
1441tile(void) { 1437tile(void) {
1442 int x, y, h, w; 1438 int x, y, h, w, mx, my, mw, mh, tx, ty, tw, th;
1443 uint i, n; 1439 uint i, n;
1444 Client *c; 1440 Client *c;
1445 1441
@@ -1447,6 +1443,18 @@ tile(void) {
1447 if(n == 0) 1443 if(n == 0)
1448 return; 1444 return;
1449 1445
1446 /* master area geometry */
1447 mx = wx;
1448 my = wy;
1449 mw = mfact * ww;
1450 mh = wh;
1451
1452 /* tile area geometry */
1453 tx = mx + mw;
1454 ty = wy;
1455 tw = ww - mw;
1456 th = wh;
1457
1450 /* master */ 1458 /* master */
1451 c = nexttiled(clients); 1459 c = nexttiled(clients);
1452 1460
@@ -1613,11 +1621,6 @@ updategeom(void) {
1613 bx = wx; 1621 bx = wx;
1614 by = showbar ? (topbar ? wy - bh : wy + wh) : -bh; 1622 by = showbar ? (topbar ? wy - bh : wy + wh) : -bh;
1615 bw = ww; 1623 bw = ww;
1616
1617 /* update layout geometries */
1618 for(i = 0; i < LENGTH(layouts); i++)
1619 if(layouts[i].updategeom)
1620 layouts[i].updategeom();
1621} 1624}
1622 1625
1623void 1626void
@@ -1673,21 +1676,6 @@ updatesizehints(Client *c) {
1673} 1676}
1674 1677
1675void 1678void
1676updatetilegeom(void) {
1677 /* master area geometry */
1678 mx = wx;
1679 my = wy;
1680 mw = mfact * ww;
1681 mh = wh;
1682
1683 /* tile area geometry */
1684 tx = mx + mw;
1685 ty = wy;
1686 tw = ww - mw;
1687 th = wh;
1688}
1689
1690void
1691updatetitle(Client *c) { 1679updatetitle(Client *c) {
1692 if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name)) 1680 if(!gettextprop(c->win, netatom[NetWMName], c->name, sizeof c->name))
1693 gettextprop(c->win, wmatom[WMName], c->name, sizeof c->name); 1681 gettextprop(c->win, wmatom[WMName], c->name, sizeof c->name);