aboutsummaryrefslogtreecommitdiff
path: root/sway/criteria.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2017-04-26 15:29:42 -0400
committerDrew DeVault <sir@cmpwn.com>2017-04-26 15:29:42 -0400
commit51143a75afe284d6c08e8a52516cba6afe834ac0 (patch)
tree33d37bb6aeb26d7db7c59a444cd72b95be35b3c8 /sway/criteria.c
parent3c1fc00f12e2777f6349a5d671b8d66c5997eb2b (diff)
Implement no_focus
Ref #2
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++) {