diff options
author | kspillner <kspillner> | 2015-05-17 04:34:01 +0000 |
---|---|---|
committer | kspillner <kspillner> | 2015-05-17 04:34:01 +0000 |
commit | d328f63c7dfe14507eb4f6f8c7c8ae1594b12dcd (patch) | |
tree | 7c38b5b27fa5826e8dbed9235e28ebeb12316ee4 | |
parent | 557cd382dcd973fd96605c3359e3d6dfa45a4fd9 (diff) | |
download | cwm-d328f63c7dfe14507eb4f6f8c7c8ae1594b12dcd.tar.gz cwm-d328f63c7dfe14507eb4f6f8c7c8ae1594b12dcd.tar.xz cwm-d328f63c7dfe14507eb4f6f8c7c8ae1594b12dcd.zip |
Make window name and window class separate parameters to conf_autogroup.
No functional change, but will be used shortly. ok okan@
-rw-r--r-- | calmwm.h | 3 | ||||
-rw-r--r-- | conf.c | 19 | ||||
-rw-r--r-- | parse.y | 2 |
3 files changed, 17 insertions, 7 deletions
diff --git a/calmwm.h b/calmwm.h index fd4b554..e8374ba 100644 --- a/calmwm.h +++ b/calmwm.h @@ -500,7 +500,8 @@ void menuq_clear(struct menu_q *); int parse_config(const char *, struct conf *); void conf_atoms(void); -void conf_autogroup(struct conf *, int, const char *); +void conf_autogroup(struct conf *, int, const char *, + const char *); int conf_bind_kbd(struct conf *, const char *, const char *); int conf_bind_mouse(struct conf *, const char *, diff --git a/conf.c b/conf.c index e5191a3..42a1c08 100644 --- a/conf.c +++ b/conf.c @@ -71,19 +71,28 @@ conf_cmd_remove(struct conf *c, const char *name) } } void -conf_autogroup(struct conf *c, int num, const char *val) +conf_autogroup(struct conf *c, int num, const char *name, const char *class) { struct autogroupwin *aw; char *p; aw = xmalloc(sizeof(*aw)); - if ((p = strchr(val, ',')) == NULL) { - aw->name = NULL; - aw->class = xstrdup(val); + if ((p = strchr(class, ',')) == NULL) { + if (name == NULL) + aw->name = NULL; + else + aw->name = xstrdup(name); + + aw->class = xstrdup(class); } else { *(p++) = '\0'; - aw->name = xstrdup(val); + + if (name == NULL) + aw->name = xstrdup(class); + else + aw->name = xstrdup(name); + aw->class = xstrdup(p); } aw->num = num; diff --git a/parse.y b/parse.y index 827472c..dbbf852 100644 --- a/parse.y +++ b/parse.y @@ -154,7 +154,7 @@ main : FONTNAME STRING { free($3); YYERROR; } - conf_autogroup(conf, $2, $3); + conf_autogroup(conf, $2, NULL, $3); free($3); } | IGNORE STRING { |