From ab4a3c9a9f59f702603e19f3eb3508a815521d6c Mon Sep 17 00:00:00 2001 From: okan Date: Fri, 24 Jun 2011 06:06:24 +0000 Subject: 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...) --- parse.y | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index e106298..a6ba528 100644 --- a/parse.y +++ b/parse.y @@ -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 @@ -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) { -- cgit v1.2.3-2-gb3c3