summaryrefslogtreecommitdiff
path: root/app/cwm
diff options
context:
space:
mode:
authorOwain Ainsworth <oga@cvs.openbsd.org>2008-05-19 17:13:56 +0000
committerOwain Ainsworth <oga@cvs.openbsd.org>2008-05-19 17:13:56 +0000
commitb32e881d4c029e5802edb6f0b2c368a55d4ad983 (patch)
tree05898bede5a5d9dd56d86f47adbbc6fad3a31da2 /app/cwm
parent18847811e55cca6a49be8683036cd30334d1498f (diff)
allow an autogroup value of 0 to mean no group. This means you can set
automatically "sticky" (in the traditional sense of the word) windows in autogroup mode. Based on an initial diff from Andrew Fresh, thanks! ok okan@.
Diffstat (limited to 'app/cwm')
-rw-r--r--app/cwm/calmwm.h4
-rw-r--r--app/cwm/cwmrc.510
-rw-r--r--app/cwm/group.c5
-rw-r--r--app/cwm/parse.y4
4 files changed, 15 insertions, 8 deletions
diff --git a/app/cwm/calmwm.h b/app/cwm/calmwm.h
index 2d1463789..fec4cba6f 100644
--- a/app/cwm/calmwm.h
+++ b/app/cwm/calmwm.h
@@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: calmwm.h,v 1.44 2008/05/19 17:11:19 okan Exp $
+ * $Id: calmwm.h,v 1.45 2008/05/19 17:13:55 oga Exp $
*/
#ifndef _CALMWM_H_
@@ -159,7 +159,7 @@ struct client_ctx {
TAILQ_HEAD(client_ctx_q, client_ctx);
static char *shortcut_to_name[] = {
- "XXX", "one", "two", "three",
+ "nogroup", "one", "two", "three",
"four", "five", "six", "seven",
"eight", "nine"
};
diff --git a/app/cwm/cwmrc.5 b/app/cwm/cwmrc.5
index 81e1e95e9..7c63c77a8 100644
--- a/app/cwm/cwmrc.5
+++ b/app/cwm/cwmrc.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: cwmrc.5,v 1.6 2008/05/18 19:57:43 okan Exp $
+.\" $OpenBSD: cwmrc.5,v 1.7 2008/05/19 17:13:55 oga Exp $
.\"
.\" Copyright (c) 2004,2005 Marius Aamodt Eriksen <marius@monkey.org>
.\"
@@ -15,7 +15,7 @@
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.\" The following requests are required for all man pages.
-.Dd $Mdocdate: May 18 2008 $
+.Dd $Mdocdate: May 19 2008 $
.Dt CWMRC 5
.Os
.Sh NAME
@@ -33,7 +33,11 @@ The following options are accepted in the configuration file:
Control automatic window grouping, based on the class and/or name
properties, where
.Ar group
-is a number between 1 and 9.
+is a number between 0 and 9.
+If the group number is 0, then the window will not be grouped; this to
+allow for
+.Dq sticky
+windows in sticky group mode.
.Pp
The class and name of a window may be obtained using
.Xr xprop 1 .
diff --git a/app/cwm/group.c b/app/cwm/group.c
index f96e8f1fe..294d7f782 100644
--- a/app/cwm/group.c
+++ b/app/cwm/group.c
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $Id: group.c,v 1.15 2008/05/19 17:11:19 okan Exp $
+ * $Id: group.c,v 1.16 2008/05/19 17:13:55 oga Exp $
*/
#include "headers.h"
@@ -328,6 +328,9 @@ group_autogroup(struct client_ctx *cc)
}
}
+ if (strncmp("nogroup", group, 7) == 0)
+ return;
+
TAILQ_FOREACH(gc, &Groupq, entry) {
if (strcmp(shortcut_to_name[gc->shortcut], group) == 0) {
_group_add(gc, cc);
diff --git a/app/cwm/parse.y b/app/cwm/parse.y
index 5c5187c18..621996027 100644
--- a/app/cwm/parse.y
+++ b/app/cwm/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.8 2008/05/18 19:43:50 oga Exp $ */
+/* $OpenBSD: parse.y,v 1.9 2008/05/19 17:13:55 oga Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -125,7 +125,7 @@ main : FONTNAME STRING {
struct autogroupwin *aw;
char *p;
- if ($2 < 1 || $2 > 9) {
+ if ($2 < 0 || $2 > 9) {
free($3);
yyerror("autogroup number out of range: %d", $2);
YYERROR;