diff options
author | okan | 2011-06-24 06:06:24 +0000 |
---|---|---|
committer | okan | 2011-06-24 06:06:24 +0000 |
commit | ab4a3c9a9f59f702603e19f3eb3508a815521d6c (patch) | |
tree | ac1d554c262b5b74f3aaca048f357f87469c49c7 /parse.y | |
parent | c94e1a5dfb1df6ef5292efe8116084f95220d1a1 (diff) | |
download | cwm-ab4a3c9a9f59f702603e19f3eb3508a815521d6c.tar.gz |
introduce a new config option to snap to the screen edge. 'snapdist'
keyword taken from a diff from Sviatoslav Chagaev to do the same thing,
but implemented in a completely way (based on some very old code from
mk@). default set to 0, so no behavior change.
ok oga@ (who would also like to take it further...)
Diffstat (limited to '')
-rw-r--r-- | parse.y | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.26 2010/09/25 20:02:58 okan Exp $ */ +/* $OpenBSD: parse.y,v 1.27 2011/06/24 06:06:24 okan Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -70,7 +70,7 @@ typedef struct { %token FONTNAME STICKY GAP MOUSEBIND %token AUTOGROUP BIND COMMAND IGNORE %token YES NO BORDERWIDTH MOVEAMOUNT -%token COLOR +%token COLOR SNAPDIST %token ACTIVEBORDER INACTIVEBORDER %token GROUPBORDER UNGROUPBORDER %token ERROR @@ -120,6 +120,9 @@ main : FONTNAME STRING { | MOVEAMOUNT NUMBER { conf->mamount = $2; } + | SNAPDIST NUMBER { + conf->snapdist = $2; + } | COMMAND STRING string { conf_cmd_add(conf, $3, $2, 0); free($2); @@ -228,6 +231,7 @@ lookup(char *s) { "mousebind", MOUSEBIND}, { "moveamount", MOVEAMOUNT}, { "no", NO}, + { "snapdist", SNAPDIST}, { "sticky", STICKY}, { "ungroupborder", UNGROUPBORDER}, { "yes", YES} @@ -523,6 +527,7 @@ parse_config(const char *filename, struct conf *xconf) xconf->flags = conf->flags; xconf->bwidth = conf->bwidth; xconf->mamount = conf->mamount; + xconf->snapdist = conf->snapdist; xconf->gap = conf->gap; while ((cmd = TAILQ_FIRST(&conf->cmdq)) != NULL) { |