diff options
Diffstat (limited to 'sway/tree')
-rw-r--r-- | sway/tree/container.c | 10 | ||||
-rw-r--r-- | sway/tree/layout.c | 16 | ||||
-rw-r--r-- | sway/tree/output.c | 10 | ||||
-rw-r--r-- | sway/tree/view.c | 4 |
4 files changed, 24 insertions, 16 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c index 9e70da09..d0d26631 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -204,9 +204,17 @@ static struct sway_container *container_workspace_destroy( } } - free(workspace->sway_workspace); + struct sway_workspace *sway_workspace = workspace->sway_workspace; + + // This emits the destroy event and also destroys the swayc. _container_destroy(workspace); + // Clean up the floating container + sway_workspace->floating->parent = NULL; + _container_destroy(sway_workspace->floating); + + free(sway_workspace); + if (output) { output_damage_whole(output->sway_output); } diff --git a/sway/tree/layout.c b/sway/tree/layout.c index d88948dc..79e7c87e 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -412,19 +412,15 @@ void container_move(struct sway_container *container, } case C_WORKSPACE: if (!is_parallel(current->layout, move_dir)) { - if (current->children->length > 2) { + if (current->children->length >= 2) { wlr_log(L_DEBUG, "Rejiggering the workspace (%d kiddos)", current->children->length); workspace_rejigger(current, container, move_dir); - } else if (current->children->length == 2) { - wlr_log(L_DEBUG, "Changing workspace layout"); - current->layout = - move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? - L_HORIZ : L_VERT; - container_insert_child(current, container, offs < 0 ? 0 : 1); - arrange_workspace(current); + return; + } else { + wlr_log(L_DEBUG, "Selecting output"); + current = current->parent; } - return; } else if (current->layout == L_TABBED || current->layout == L_STACKED) { wlr_log(L_DEBUG, "Rejiggering out of tabs/stacks"); @@ -520,7 +516,7 @@ void container_move(struct sway_container *container, wlr_log(L_DEBUG, "Reparenting container (perpendicular)"); struct sway_container *focus_inactive = seat_get_focus_inactive( config->handler_context.seat, sibling); - if (focus_inactive) { + if (focus_inactive && focus_inactive != sibling) { while (focus_inactive->parent != sibling) { focus_inactive = focus_inactive->parent; } diff --git a/sway/tree/output.c b/sway/tree/output.c index 6c7044a2..8823eba0 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -8,10 +8,6 @@ struct sway_container *output_create( struct sway_output *sway_output) { - struct wlr_box size; - wlr_output_effective_resolution(sway_output->wlr_output, &size.width, - &size.height); - const char *name = sway_output->wlr_output->name; char identifier[128]; output_get_identifier(identifier, sizeof(identifier), sway_output); @@ -54,6 +50,12 @@ struct sway_container *output_create( container_add_child(&root_container, output); load_swaybars(); + struct wlr_box size; + wlr_output_effective_resolution(sway_output->wlr_output, &size.width, + &size.height); + output->width = size.width; + output->height = size.height; + // Create workspace char *ws_name = workspace_next_name(output->name); wlr_log(L_DEBUG, "Creating default workspace %s", ws_name); diff --git a/sway/tree/view.c b/sway/tree/view.c index 79441d49..c9c82405 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -790,8 +790,10 @@ void view_update_title(struct sway_view *view, bool force) { view->swayc->formatted_title = NULL; } container_calculate_title_height(view->swayc); - container_update_title_textures(view->swayc); config_update_font_height(false); + + // Update title after the global font height is updated + container_update_title_textures(view->swayc); } static bool find_by_mark_iterator(struct sway_container *con, |