about summary refs log tree commit diff
path: root/group.c
diff options
context:
space:
mode:
authorokan <okan>2013-01-13 13:55:12 +0000
committerokan <okan>2013-01-13 13:55:12 +0000
commit47aa485fa259965609d3e13cce7a03ac64b14e6f (patch)
tree770ff8cfe55ed1aae9ede73fba63e84dffda8aae /group.c
parent62acbee4b3f0bb69db00c070d8b92ed0db2caf5d (diff)
downloadcwm-47aa485fa259965609d3e13cce7a03ac64b14e6f.tar.gz
cwm-47aa485fa259965609d3e13cce7a03ac64b14e6f.tar.xz
cwm-47aa485fa259965609d3e13cce7a03ac64b14e6f.zip
put back r1.68 which allows an empty group to be sticky; behavior
change noticed by Thomas Pfaff and diagnosis why we need to
group_setactive in this case by Alexander Polakov.  replace XXX with
a useful comment.
Diffstat (limited to 'group.c')
-rw-r--r--group.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/group.c b/group.c
index b8bf59a..6644dce 100644
--- a/group.c
+++ b/group.c
@@ -269,8 +269,12 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
 
 	if (gc->hidden)
 		group_show(sc, gc);
-	else
+	else {
 		group_hide(sc, gc);
+		/* make clients stick to empty group */
+		if (TAILQ_EMPTY(&gc->clients))
+			group_setactive(sc, idx);
+	}
 }
 
 void