aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-06-05 08:44:16 +0100
committerLibravatar GitHub <noreply@github.com>2018-06-05 08:44:16 +0100
commite410757fe8f1eaa1883a60ac93b96f35d36ae938 (patch)
tree102fcc6e5aee71454b560de05f53de6141c5c962
parentMerge pull request #2087 from RedSoxFan/output-subcommand (diff)
parentFix movement crashes/issues (diff)
downloadsway-e410757fe8f1eaa1883a60ac93b96f35d36ae938.tar.gz
sway-e410757fe8f1eaa1883a60ac93b96f35d36ae938.tar.zst
sway-e410757fe8f1eaa1883a60ac93b96f35d36ae938.zip
Merge pull request #2106 from RedSoxFan/fix-2105
Fix movement crashes/issues
-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,
412 } 412 }
413 case C_WORKSPACE: 413 case C_WORKSPACE:
414 if (!is_parallel(current->layout, move_dir)) { 414 if (!is_parallel(current->layout, move_dir)) {
415 if (current->children->length > 2) { 415 if (current->children->length >= 2) {
416 wlr_log(L_DEBUG, "Rejiggering the workspace (%d kiddos)", 416 wlr_log(L_DEBUG, "Rejiggering the workspace (%d kiddos)",
417 current->children->length); 417 current->children->length);
418 workspace_rejigger(current, container, move_dir); 418 workspace_rejigger(current, container, move_dir);
419 } else if (current->children->length == 2) { 419 return;
420 wlr_log(L_DEBUG, "Changing workspace layout"); 420 } else {
421 current->layout = 421 wlr_log(L_DEBUG, "Selecting output");
422 move_dir == MOVE_LEFT || move_dir == MOVE_RIGHT ? 422 current = current->parent;
423 L_HORIZ : L_VERT;
424 container_insert_child(current, container, offs < 0 ? 0 : 1);
425 arrange_workspace(current);
426 } 423 }
427 return;
428 } else if (current->layout == L_TABBED 424 } else if (current->layout == L_TABBED
429 || current->layout == L_STACKED) { 425 || current->layout == L_STACKED) {
430 wlr_log(L_DEBUG, "Rejiggering out of tabs/stacks"); 426 wlr_log(L_DEBUG, "Rejiggering out of tabs/stacks");
@@ -520,7 +516,7 @@ void container_move(struct sway_container *container,
520 wlr_log(L_DEBUG, "Reparenting container (perpendicular)"); 516 wlr_log(L_DEBUG, "Reparenting container (perpendicular)");
521 struct sway_container *focus_inactive = seat_get_focus_inactive( 517 struct sway_container *focus_inactive = seat_get_focus_inactive(
522 config->handler_context.seat, sibling); 518 config->handler_context.seat, sibling);
523 if (focus_inactive) { 519 if (focus_inactive && focus_inactive != sibling) {
524 while (focus_inactive->parent != sibling) { 520 while (focus_inactive->parent != sibling) {
525 focus_inactive = focus_inactive->parent; 521 focus_inactive = focus_inactive->parent;
526 } 522 }