aboutsummaryrefslogtreecommitdiff
path: root/sway/criteria.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-04-26 17:20:12 -0400
committerGitHub <noreply@github.com>2017-04-26 17:20:12 -0400
commit11b4c3454c65375db88901165f0a69c978e3977f (patch)
tree97fabe0d36c2c5574a2ff47238eeed58fa200fd0 /sway/criteria.c
parent3c1fc00f12e2777f6349a5d671b8d66c5997eb2b (diff)
parent537261f23f194e152c0adf25a2740375929e9cd3 (diff)
Merge pull request #1196 from SirCmpwn/no_focus
Implement no_focus
Diffstat (limited to 'sway/criteria.c')
-rw-r--r--sway/criteria.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/sway/criteria.c b/sway/criteria.c
index ee6d4d1c..1ea8311e 100644
--- a/sway/criteria.c
+++ b/sway/criteria.c
@@ -359,6 +359,16 @@ void free_criteria(struct criteria *crit) {
free(crit);
}
+bool criteria_any(swayc_t *cont, list_t *criteria) {
+ for (int i = 0; i < criteria->length; i++) {
+ struct criteria *bc = criteria->items[i];
+ if (criteria_test(cont, bc->tokens)) {
+ return true;
+ }
+ }
+ return false;
+}
+
list_t *criteria_for(swayc_t *cont) {
list_t *criteria = config->criteria, *matches = create_list();
for (int i = 0; i < criteria->length; i++) {