summary refs log tree commit diff
path: root/group.c
diff options
context:
space:
mode:
authorokan <okan>2016-09-02 16:07:11 +0000
committerokan <okan>2016-09-02 16:07:11 +0000
commitc82c3f08356d4debd69f1f15be3fc065a2010b8e (patch)
treeea7cb635938131bcaad524d94517c8dcefda469f /group.c
parent67a9eaa440ddc535fc7707883baca9f263cf4ae8 (diff)
downloadcwm-c82c3f08356d4debd69f1f15be3fc065a2010b8e.tar.gz
cwm-c82c3f08356d4debd69f1f15be3fc065a2010b8e.tar.xz
cwm-c82c3f08356d4debd69f1f15be3fc065a2010b8e.zip
Simplify group_holds_only_hidden(); from Vadim Vygonets.
Diffstat (limited to 'group.c')
-rw-r--r--group.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/group.c b/group.c
index c39e0f1..81961e7 100644
--- a/group.c
+++ b/group.c
@@ -209,19 +209,12 @@ int
 group_holds_only_hidden(struct group_ctx *gc)
 {
 	struct client_ctx	*cc;
-	int			 hidden = 0, same = 0;
 
 	TAILQ_FOREACH(cc, &gc->clientq, group_entry) {
-		if (cc->flags & CLIENT_STICKY)
-			continue;
-		if (hidden == ((cc->flags & CLIENT_HIDDEN) ? 1 : 0))
-			same++;
+		if (!(cc->flags & (CLIENT_HIDDEN | CLIENT_STICKY)))
+			return(0);
 	}
-
-	if (same == 0)
-		hidden = !hidden;
-
-	return(hidden);
+	return(1);
 }
 
 void