aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/container.c
diff options
context:
space:
mode:
authorRyan Dwyer <ryandwyer1@gmail.com>2018-06-06 22:57:34 +1000
committerRyan Dwyer <ryandwyer1@gmail.com>2018-06-09 10:11:25 +1000
commitbb66e6d578fdc68fb33d0fde921390d74f20bb31 (patch)
tree99d3763eee97acb870c16a762c0ee40af787c295 /sway/tree/container.c
parentf9e6d703d298dbdee0770fd9e0c64ab2d7ac7deb (diff)
Refactor everything that needs to arrange windows
* The arrange_foo functions are now replaced with arrange_and_commit, or with manually created transactions and arrange_windows x2. * The arrange functions are now only called from the highest level functions rather than from both high level and low level functions. * Due to the previous point, view_set_fullscreen_raw and view_set_fullscreen are both merged into one function again. * Floating and fullscreen are now working with transactions.
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r--sway/tree/container.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index e6956f5c..d312eb60 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -204,6 +204,7 @@ static struct sway_container *container_workspace_destroy(
container_move_to(floating->children->items[i],
new_workspace->sway_workspace->floating);
}
+ arrange_and_commit(new_workspace);
}
struct sway_workspace *sway_workspace = workspace->sway_workspace;
@@ -264,10 +265,10 @@ static struct sway_container *container_output_destroy(
}
container_sort_workspaces(new_output);
- arrange_output(new_output);
}
}
}
+ arrange_and_commit(&root_container);
wl_list_remove(&output->sway_output->mode.link);
wl_list_remove(&output->sway_output->transform.link);
@@ -924,13 +925,12 @@ void container_set_floating(struct sway_container *container, bool enable) {
struct sway_container *workspace = container_parent(container, C_WORKSPACE);
struct sway_seat *seat = input_manager_current_seat(input_manager);
- container_damage_whole(container);
if (enable) {
container_remove_child(container);
container_add_child(workspace->sway_workspace->floating, container);
if (container->type == C_VIEW) {
- view_autoconfigure(container->sway_view);
+ view_init_floating(container->sway_view);
}
seat_set_focus(seat, seat_get_focus_inactive(seat, container));
container_reap_empty_recursive(workspace);
@@ -943,8 +943,8 @@ void container_set_floating(struct sway_container *container, bool enable) {
container->is_sticky = false;
container_reap_empty_recursive(workspace->sway_workspace->floating);
}
- arrange_workspace(workspace);
- container_damage_whole(container);
+
+ ipc_event_window(container, "floating");
}
void container_set_geometry_from_floating_view(struct sway_container *con) {