[wmfs, config] Add resizehint option ( tag option)

This commit is contained in:
Martin Duquesnoy 2008-10-08 23:47:26 +02:00
parent a23225fa7b
commit 32f292f677
4 changed files with 13 additions and 10 deletions

View File

@ -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"));
}
}

View File

@ -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;
}

1
wmfs.h
View File

@ -127,6 +127,7 @@ typedef struct
char *name;
float mwfact;
int nmaster;
Bool resizehint;
Layout layout;
} Tag;

2
wmfsrc
View File

@ -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" }