mirror of
https://github.com/swaywm/sway.git
synced 2026-04-18 06:46:56 -04:00
Add the swap_workspace command
The added command allow the user to swap the contents of two workspaces. Co-authored-by: Arne <ge47com@tum.de>
This commit is contained in:
parent
c5fd8c050f
commit
c2eaf01767
7 changed files with 211 additions and 0 deletions
|
|
@ -430,6 +430,20 @@ struct sway_container *container_at(struct sway_workspace *workspace,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void container_get_first_view(struct sway_container *container,
|
||||
struct sway_container **view) {
|
||||
if (container->view) {
|
||||
*view = container;
|
||||
}
|
||||
|
||||
if (container->pending.children) {
|
||||
for (int i = 0; i < container->pending.children->length; ++i) {
|
||||
struct sway_container *child = container->pending.children->items[i];
|
||||
container_get_first_view(child, view);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void container_for_each_child(struct sway_container *container,
|
||||
void (*f)(struct sway_container *container, void *data),
|
||||
void *data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue