aboutsummaryrefslogtreecommitdiff
path: root/sway
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2018-06-05 08:44:16 +0100
committerGitHub <noreply@github.com>2018-06-05 08:44:16 +0100
commite410757fe8f1eaa1883a60ac93b96f35d36ae938 (patch)
tree102fcc6e5aee71454b560de05f53de6141c5c962 /sway
parent0549fd027bee17d2ee904ccf7e6447a8f79d9f7f (diff)
parent9aaac8b8c8ad3e7fca8338f236b51c92b63d09a2 (diff)
Merge pull request #2106 from RedSoxFan/fix-2105
Fix movement crashes/issues
Diffstat (limited to 'sway')
-rw-r--r--sway/tree/layout.c16
1 files changed, 6 insertions, 10 deletions
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;
}