From 32f292f67706ef738ec09eea4b76f2406e1a496c Mon Sep 17 00:00:00 2001 From: Martin Duquesnoy Date: Wed, 8 Oct 2008 23:47:26 +0200 Subject: [PATCH] [wmfs, config] Add resizehint option ( tag option) --- config.c | 18 ++++++++++-------- layout.c | 2 +- wmfs.h | 1 + wmfsrc | 2 +- 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/config.c b/config.c index 08fb42e..2ccd6ce 100644 --- a/config.c +++ b/config.c @@ -204,10 +204,11 @@ init_conf(void) static cfg_opt_t tag_opts[] = { - CFG_STR("name", "", CFGF_NONE), - CFG_FLOAT("mwfact", 0.65, CFGF_NONE), - CFG_INT("nmaster", 1, CFGF_NONE), - CFG_STR("layout", "tile", CFGF_NONE), + CFG_STR("name", "", CFGF_NONE), + CFG_FLOAT("mwfact", 0.65, CFGF_NONE), + CFG_INT("nmaster", 1, CFGF_NONE), + CFG_STR("layout", "tile", CFGF_NONE), + CFG_BOOL("resizehint", cfg_false, CFGF_NONE), CFG_END() }; @@ -413,10 +414,11 @@ init_conf(void) for(i = 0; i < conf.ntag; ++i) { cfgtmp = cfg_getnsec(cfg_tags, "tag", i); - conf.tag[i].name = strdup(cfg_getstr(cfgtmp, "name")); - conf.tag[i].mwfact = cfg_getfloat(cfgtmp, "mwfact"); - conf.tag[i].nmaster = cfg_getint(cfgtmp, "nmaster"); - conf.tag[i].layout = layout_name_to_struct(conf.layout, cfg_getstr(cfgtmp, "layout")); + conf.tag[i].name = strdup(cfg_getstr(cfgtmp, "name")); + conf.tag[i].mwfact = cfg_getfloat(cfgtmp, "mwfact"); + conf.tag[i].nmaster = cfg_getint(cfgtmp, "nmaster"); + conf.tag[i].resizehint = cfg_getbool(cfgtmp, "resizehint"); + conf.tag[i].layout = layout_name_to_struct(conf.layout, cfg_getstr(cfgtmp, "layout")); } } diff --git a/layout.c b/layout.c index 1c010ea..907cfc3 100644 --- a/layout.c +++ b/layout.c @@ -219,7 +219,7 @@ tile(void) else h = th - (bord + conf.ttbarheight) - bord*2; } - moveresize(c, x, y, w, h, False); + moveresize(c, x, y, w, h, tags[seltag].resizehint); if(n > nm && th != mht) y = c->y + c->h + bord + conf.ttbarheight; } diff --git a/wmfs.h b/wmfs.h index e3cf68e..559d3f1 100644 --- a/wmfs.h +++ b/wmfs.h @@ -127,6 +127,7 @@ typedef struct char *name; float mwfact; int nmaster; + Bool resizehint; Layout layout; } Tag; diff --git a/wmfsrc b/wmfsrc index 6812e6a..e421928 100644 --- a/wmfsrc +++ b/wmfsrc @@ -60,7 +60,7 @@ layouts tags { - tag { name = "one" mwfact = 0.65 nmaster = 2 layout = "tile" } + tag { name = "one" mwfact = 0.65 nmaster = 2 layout = "tile" resizehint = false } tag { name = "two" } tag { name = "three" } tag { name = "four" }