diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-06 22:57:34 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-06-09 10:11:25 +1000 |
commit | bb66e6d578fdc68fb33d0fde921390d74f20bb31 (patch) | |
tree | 99d3763eee97acb870c16a762c0ee40af787c295 /sway/tree/container.c | |
parent | Make main properties be the pending state (diff) | |
download | sway-bb66e6d578fdc68fb33d0fde921390d74f20bb31.tar.gz sway-bb66e6d578fdc68fb33d0fde921390d74f20bb31.tar.zst sway-bb66e6d578fdc68fb33d0fde921390d74f20bb31.zip |
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.c | 10 |
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( | |||
204 | container_move_to(floating->children->items[i], | 204 | container_move_to(floating->children->items[i], |
205 | new_workspace->sway_workspace->floating); | 205 | new_workspace->sway_workspace->floating); |
206 | } | 206 | } |
207 | arrange_and_commit(new_workspace); | ||
207 | } | 208 | } |
208 | 209 | ||
209 | struct sway_workspace *sway_workspace = workspace->sway_workspace; | 210 | struct sway_workspace *sway_workspace = workspace->sway_workspace; |
@@ -264,10 +265,10 @@ static struct sway_container *container_output_destroy( | |||
264 | } | 265 | } |
265 | 266 | ||
266 | container_sort_workspaces(new_output); | 267 | container_sort_workspaces(new_output); |
267 | arrange_output(new_output); | ||
268 | } | 268 | } |
269 | } | 269 | } |
270 | } | 270 | } |
271 | arrange_and_commit(&root_container); | ||
271 | 272 | ||
272 | wl_list_remove(&output->sway_output->mode.link); | 273 | wl_list_remove(&output->sway_output->mode.link); |
273 | wl_list_remove(&output->sway_output->transform.link); | 274 | wl_list_remove(&output->sway_output->transform.link); |
@@ -924,13 +925,12 @@ void container_set_floating(struct sway_container *container, bool enable) { | |||
924 | 925 | ||
925 | struct sway_container *workspace = container_parent(container, C_WORKSPACE); | 926 | struct sway_container *workspace = container_parent(container, C_WORKSPACE); |
926 | struct sway_seat *seat = input_manager_current_seat(input_manager); | 927 | struct sway_seat *seat = input_manager_current_seat(input_manager); |
927 | container_damage_whole(container); | ||
928 | 928 | ||
929 | if (enable) { | 929 | if (enable) { |
930 | container_remove_child(container); | 930 | container_remove_child(container); |
931 | container_add_child(workspace->sway_workspace->floating, container); | 931 | container_add_child(workspace->sway_workspace->floating, container); |
932 | if (container->type == C_VIEW) { | 932 | if (container->type == C_VIEW) { |
933 | view_autoconfigure(container->sway_view); | 933 | view_init_floating(container->sway_view); |
934 | } | 934 | } |
935 | seat_set_focus(seat, seat_get_focus_inactive(seat, container)); | 935 | seat_set_focus(seat, seat_get_focus_inactive(seat, container)); |
936 | container_reap_empty_recursive(workspace); | 936 | container_reap_empty_recursive(workspace); |
@@ -943,8 +943,8 @@ void container_set_floating(struct sway_container *container, bool enable) { | |||
943 | container->is_sticky = false; | 943 | container->is_sticky = false; |
944 | container_reap_empty_recursive(workspace->sway_workspace->floating); | 944 | container_reap_empty_recursive(workspace->sway_workspace->floating); |
945 | } | 945 | } |
946 | arrange_workspace(workspace); | 946 | |
947 | container_damage_whole(container); | 947 | ipc_event_window(container, "floating"); |
948 | } | 948 | } |
949 | 949 | ||
950 | void container_set_geometry_from_floating_view(struct sway_container *con) { | 950 | void container_set_geometry_from_floating_view(struct sway_container *con) { |