Implement no_focus

Ref #2
This commit is contained in:
Drew DeVault 2017-04-26 15:29:42 -04:00
parent 3c1fc00f12
commit 51143a75af
8 changed files with 72 additions and 3 deletions

View file

@ -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++) {