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.
This commit is contained in:
Ryan Dwyer 2018-06-06 22:57:34 +10:00
parent f9e6d703d2
commit bb66e6d578
24 changed files with 192 additions and 171 deletions

View file

@ -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) {