diff options
Diffstat (limited to 'dwm.c')
-rw-r--r-- | dwm.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -143,6 +143,7 @@ typedef struct { } Rule; /* function declarations */ +static void applydefaultlayouts(); static void applyrules(Client *c); static int applysizehints(Client *c, int *x, int *y, int *w, int *h, int interact); static void arrange(Monitor *m); @@ -296,6 +297,21 @@ struct NumTags { char limitexceeded[LENGTH(tags) > 31 ? -1 : 1]; }; /* function implementations */ void +applydefaultlayouts() +{ + Monitor *m; + int i = 0; + for (m = mons; m; m = m->next) { + if (i < LENGTH(lpm)) { + m->lt[0] = &layouts[lpm[i]]; + m->lt[1] = &layouts[(lpm[i] + 1)/ LENGTH(layouts)]; + strncpy(m->ltsymbol, layouts[i].symbol, sizeof m->ltsymbol); + } + i++; + } +} + +void applyrules(Client *c) { const char *class, *instance; @@ -2119,6 +2135,7 @@ updategeom(void) selmon = mons; cleanupmon(m); } + applydefaultlayouts(); free(unique); } else #endif /* XINERAMA */ |