mirror of
https://github.com/swaywm/sway.git
synced 2025-11-15 06:59:50 -05:00
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
This commit is contained in:
parent
89dc047ca9
commit
81e8f31cc6
13 changed files with 290 additions and 5 deletions
|
|
@ -225,6 +225,14 @@ list_t *criteria_get_views(struct criteria *criteria) {
|
|||
};
|
||||
container_for_each_descendant_dfs(&root_container,
|
||||
criteria_get_views_iterator, &data);
|
||||
|
||||
// Scratchpad items which are hidden are not in the tree.
|
||||
for (int i = 0; i < server.scratchpad->length; ++i) {
|
||||
struct sway_container *con = server.scratchpad->items[i];
|
||||
if (!con->parent) {
|
||||
criteria_get_views_iterator(con, &data);
|
||||
}
|
||||
}
|
||||
return matches;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue