summary refs log tree commit diff
diff options
context:
space:
mode:
authorokan <okan>2011-12-29 20:48:38 +0000
committerokan <okan>2011-12-29 20:48:38 +0000
commitfd9b83a232ecfbd1bcd5c5e80117931019964db4 (patch)
treedbb44167f38c54367270b8c7187439eff260f478
parent22c2bc618b6cd047aee2f54ee7c526c39e846885 (diff)
downloadcwm-fd9b83a232ecfbd1bcd5c5e80117931019964db4.tar.gz
cwm-fd9b83a232ecfbd1bcd5c5e80117931019964db4.tar.xz
cwm-fd9b83a232ecfbd1bcd5c5e80117931019964db4.zip
check if we're in the group already, else multiple calls to
group_movetogroup() on one client will still increment nhidden if the
group is hidden.

found the hard way by Thomas Jeunet and fix from Alexander Polakov -
thanks to both!

ok oga@
-rw-r--r--group.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/group.c b/group.c
index 24933d9..68068b1 100644
--- a/group.c
+++ b/group.c
@@ -222,11 +222,13 @@ group_movetogroup(struct client_ctx *cc, int idx)
 		err(1, "group_movetogroup: index out of range (%d)", idx);
 
 	gc = &sc->groups[idx];
+	if (cc->group == gc)
+		return;
 	if (gc->hidden) {
 		client_hide(cc);
 		gc->nhidden++;
 	}
-	group_add(&sc->groups[idx], cc);
+	group_add(gc, cc);
 }
 
 /*