X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=wm-wmii.c;h=6618adb38b62695f9c969004491af74c51d53ce8;hb=81df0eb31af414e4712fb8c81d0bdc4fd4cbb641;hp=ac1333325dfb656ceedc864148f747594623212b;hpb=79245152446fc0b9e3523135beabbd6783d2026a;p=wmpus diff --git a/wm-wmii.c b/wm-wmii.c index ac13333..6618adb 100644 --- a/wm-wmii.c +++ b/wm-wmii.c @@ -17,18 +17,16 @@ #include #include "util.h" +#include "conf.h" #include "sys.h" #include "wm.h" +/* Configuration */ #ifndef MODKEY #define MODKEY alt #endif -#ifndef MARGIN -#define MARGIN 0 -#endif -#ifndef STACK -#define STACK 25 -#endif +static int MARGIN = 0; +static int STACK = 25; /* Enums */ typedef enum { @@ -590,15 +588,14 @@ static void tag_switch(int name) printf("tag_switch: %d\n", name); tag_t *old = wm_tag; if ((wm_col == NULL || wm_row == NULL) && wm_flt == NULL) { - list_t *ltag = list_find(wm->tags, old); - wm->tags = list_remove(wm->tags, ltag, 1); while (old->dpys) { dpy_t *dpy = old->dpys->data; while (dpy->cols) dpy->cols = list_remove(dpy->cols, dpy->cols, 1); old->dpys = list_remove(old->dpys, old->dpys, 1); } - free(old); + list_t *ltag = list_find(wm->tags, old); + wm->tags = list_remove(wm->tags, ltag, 1); } wm_tag = tag_find(name); } @@ -886,6 +883,10 @@ void wm_init(win_t *root) { printf("wm_init: %p\n", root); + /* Load configuration */ + MARGIN = conf_get_int("main.margin", MARGIN); + STACK = conf_get_int("main.stack", STACK); + /* Hack, fix screen order */ list_t *screens = sys_info(root); list_t *left = screens;