diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-22 14:10:40 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-07-23 08:24:32 +1000 |
commit | 81e8f31cc6f284b54ab206e14af7ecbc1a9ed1bb (patch) | |
tree | ea124a94869d06edb3f98e85ecd649275e86ef91 /sway/criteria.c | |
parent | Merge pull request #2328 from emersion/xdg-shell-set-title (diff) | |
download | sway-81e8f31cc6f284b54ab206e14af7ecbc1a9ed1bb.tar.gz sway-81e8f31cc6f284b54ab206e14af7ecbc1a9ed1bb.tar.zst sway-81e8f31cc6f284b54ab206e14af7ecbc1a9ed1bb.zip |
Implement scratchpad
Implements the following commands:
* move scratchpad
* scratchpad show
* [criteria] scratchpad show
Also fixes these:
* Fix memory leak when executing command with criteria
(use `list_free(views)` instead of `free(views)`)
* Fix crash when running `move to` with no further arguments
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 e2b248de..6af97d5b 100644 --- a/sway/criteria.c +++ b/sway/criteria.c | |||
@@ -225,6 +225,14 @@ list_t *criteria_get_views(struct criteria *criteria) { | |||
225 | }; | 225 | }; |
226 | container_for_each_descendant_dfs(&root_container, | 226 | container_for_each_descendant_dfs(&root_container, |
227 | criteria_get_views_iterator, &data); | 227 | criteria_get_views_iterator, &data); |
228 | |||
229 | // Scratchpad items which are hidden are not in the tree. | ||
230 | for (int i = 0; i < server.scratchpad->length; ++i) { | ||
231 | struct sway_container *con = server.scratchpad->items[i]; | ||
232 | if (!con->parent) { | ||
233 | criteria_get_views_iterator(con, &data); | ||
234 | } | ||
235 | } | ||
228 | return matches; | 236 | return matches; |
229 | } | 237 | } |
230 | 238 | ||