diff options
author | Brian Ashworth <bosrsf04@gmail.com> | 2018-06-05 01:13:27 -0400 |
---|---|---|
committer | Brian Ashworth <bosrsf04@gmail.com> | 2018-06-05 01:13:27 -0400 |
commit | 9aaac8b8c8ad3e7fca8338f236b51c92b63d09a2 (patch) | |
tree | 102fcc6e5aee71454b560de05f53de6141c5c962 | |
parent | Merge pull request #2087 from RedSoxFan/output-subcommand (diff) | |
download | sway-9aaac8b8c8ad3e7fca8338f236b51c92b63d09a2.tar.gz sway-9aaac8b8c8ad3e7fca8338f236b51c92b63d09a2.tar.zst sway-9aaac8b8c8ad3e7fca8338f236b51c92b63d09a2.zip |
Fix movement crashes/issues
-rw-r--r-- | sway/tree/layout.c | 16 |
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 | } |