From a99a1f0cc9934c019b0d31ce030a32f77725865a Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 19 Mar 2017 17:57:44 -0400 Subject: [PATCH] Merge pull request #1130 from oranenj/fix_move_next_crash Fix move next crash --- sway/container.c | 2 +- sway/layout.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sway/container.c b/sway/container.c index 2f656bd8e..427f71a4f 100644 --- a/sway/container.c +++ b/sway/container.c @@ -218,7 +218,7 @@ swayc_t *new_workspace(swayc_t *output, const char *name) { swayc_t *workspace = new_swayc(C_WORKSPACE); workspace->prev_layout = L_NONE; - workspace->layout = L_HORIZ; + workspace->layout = default_layout(output); workspace->workspace_layout = default_layout(output); workspace->x = output->x; diff --git a/sway/layout.c b/sway/layout.c index 5e144cd87..6a493df2b 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -395,7 +395,7 @@ void move_container(swayc_t *container, enum movement_direction dir) { sway_log(L_DEBUG, "container:%p, parent:%p, child %p,", container,parent,child); if (parent->layout == layout - || (layout == L_NONE && parent->type == C_CONTAINER) /* accept any layout for next/prev direction */ + || (layout == L_NONE && (parent->type == C_CONTAINER || parent->type == C_WORKSPACE)) /* accept any layout for next/prev direction */ || (parent->layout == L_TABBED && layout == L_HORIZ) || (parent->layout == L_STACKED && layout == L_VERT) || is_auto_layout(parent->layout)) {