diff options
Diffstat (limited to 'sway/tree/container.c')
-rw-r--r-- | sway/tree/container.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index af55a54e..f8620b72 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -116,6 +116,7 @@ struct sway_container *container_create(enum sway_container_type type) { if (type != C_VIEW) { c->children = create_list(); + //c->pending.children = create_list(); } wl_signal_init(&c->events.destroy); @@ -167,6 +168,7 @@ static void _container_destroy(struct sway_container *cont) { wlr_texture_destroy(cont->title_urgent); list_free(cont->children); + //list_free(cont->pending.children); cont->children = NULL; free(cont); } @@ -207,6 +209,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; @@ -267,10 +270,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); @@ -927,13 +930,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); @@ -946,8 +948,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) { @@ -976,3 +978,12 @@ bool container_is_floating(struct sway_container *container) { } return container->parent == workspace->sway_workspace->floating; } + +struct wlr_box *container_get_box(struct sway_container *container) { + struct wlr_box *box = calloc(1, sizeof(struct wlr_box)); + box->x = container->x; + box->y = container->y; + box->width = container->width; + box->height = container->height; + return box; +} |