diff options
author | Drew DeVault <[email protected]> | 2017-10-08 11:26:45 -0400 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2017-10-08 11:26:45 -0400 |
commit | 6271abd644da15070d29d2d06bc527f89a799375 (patch) | |
tree | a6b07648871ac884e5770f070224907973c5ac43 /sway/criteria.c | |
parent | eb7b920303f0589fd5220a3d025b9c678d7c7a16 (diff) |
Fix #1291
Diffstat (limited to 'sway/criteria.c')
-rw-r--r-- | sway/criteria.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sway/criteria.c b/sway/criteria.c index f5fe40cb..e8978ebe 100644 --- a/sway/criteria.c +++ b/sway/criteria.c @@ -434,10 +434,18 @@ static void container_match_add(swayc_t *container, struct list_tokens *list_tok list_add(list_tokens->list, container); } } + list_t *container_for(list_t *tokens) { struct list_tokens list_tokens = (struct list_tokens){create_list(), tokens}; container_map(&root_container, (void (*)(swayc_t *, void *))container_match_add, &list_tokens); + + for (int i = 0; i < scratchpad->length; ++i) { + swayc_t *c = scratchpad->items[i]; + if (criteria_test(c, tokens)) { + list_add(list_tokens.list, c); + } + } return list_tokens.list; } |