diff options
author | Drew DeVault <[email protected]> | 2015-08-25 16:12:37 -0400 |
---|---|---|
committer | Drew DeVault <[email protected]> | 2015-08-25 16:12:37 -0400 |
commit | fa6292ff24082f90886353844b45e99ec965daa5 (patch) | |
tree | 06f9219532f6f057410910dbfe43d3884acd90bc /sway/layout.c | |
parent | 2e755cf13fb653a397a8895121184322dc1dcdd6 (diff) | |
parent | 95353051379126f99d310936a46052b4a89bd880 (diff) |
Merge pull request #129 from minus7/workspaces
Implemented "move container to workspace"
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sway/layout.c b/sway/layout.c index a37e137c..cd47037b 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -203,6 +203,21 @@ void move_container(swayc_t *container,swayc_t* root,enum movement_direction dir } +void move_container_to(swayc_t* container, swayc_t* destination) { + if (container->parent == destination) { + return; + } + destroy_container(remove_child(container)); + set_focused_container(get_focused_view(&root_container)); + if (container->is_floating) { + add_floating(destination, container); + } else { + add_child(destination, container); + } + update_visibility(container); + arrange_windows(&root_container, -1, -1); +} + void update_geometry(swayc_t *container) { if (container->type != C_VIEW) { return; |