From d06c1ac1e96c3a5716b6dd8e5ee443674df36020 Mon Sep 17 00:00:00 2001 From: Ronan Pigott Date: Wed, 21 Oct 2020 09:42:40 -0700 Subject: [PATCH 1/3] commands/move: fix crash when moving sphsc child --- sway/commands/move.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sway/commands/move.c b/sway/commands/move.c index 959e5bfbf..876a56167 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -537,7 +537,8 @@ static struct cmd_results *cmd_move_container(bool no_auto_back_and_forth, struct sway_node *focus = seat_get_focus(seat); // move container - if (container->scratchpad) { + if (container_is_scratchpad_hidden_or_child(container)) { + container_detach(container); root_scratchpad_show(container); } switch (destination->type) { From 13a67da614449ec95d1dc1927ed7dca6a1c54fb7 Mon Sep 17 00:00:00 2001 From: mwenzkowski <29407878+mwenzkowski@users.noreply.github.com> Date: Sat, 24 Oct 2020 17:27:38 +0200 Subject: [PATCH 2/3] container: Fix NULL pointer dereference Reset the workspace layout to the output's default only if the workspace is actually attached to an output. Fixes #5762 --- sway/tree/container.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sway/tree/container.c b/sway/tree/container.c index fe622c7bf..3e2341864 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -1358,7 +1358,9 @@ void container_detach(struct sway_container *child) { // We may have removed the last tiling child from the workspace. If the // workspace layout was e.g. tabbed, then at this point it may be just // H[]. So, reset it to the default (e.g. T[]) for next time. - if (!old_workspace->tiling->length) { + // But if we are evacuating a workspace with only sticky floating + // containers, the workspace will already be detached from the output. + if (old_workspace->output && !old_workspace->tiling->length) { old_workspace->layout = output_get_default_layout(old_workspace->output); } From 0cb9282aeebddeed0b5259f153f98a45311053a5 Mon Sep 17 00:00:00 2001 From: Dimitris Triantafyllidis Date: Sun, 25 Oct 2020 23:20:19 +0200 Subject: [PATCH 3/3] Smart borders fix: always show borders for floating containers Currently, in view_autoconfigure, the only condition for show_border is !view_is_only_visible. view_is_only_visible does not cross the boundary between the workspace's tiling and floating lists and does not differentiate between them. The result is, that in a workspace with zero or more tiling containers and a single floating container, the floating container will lose its borders as soon as it is split, provided that a only one view is visible within the floating container. Fixed by adjusting the condition for show_borders. --- sway/tree/view.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sway/tree/view.c b/sway/tree/view.c index 7bba29234..d699b01eb 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c @@ -280,7 +280,8 @@ void view_autoconfigure(struct sway_view *view) { (config->hide_edge_borders_smart == ESMART_NO_GAPS && !gaps_to_edge(view)); if (smart) { - bool show_border = !view_is_only_visible(view); + bool show_border = container_is_floating_or_child(con) || + !view_is_only_visible(view); con->border_left &= show_border; con->border_right &= show_border; con->border_top &= show_border;