aboutsummaryrefslogtreecommitdiff
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index cf16d5c5..21cec529 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -149,7 +149,7 @@ struct sway_container *container_remove_child(struct sway_container *child) {
}
}
child->parent = NULL;
- container_notify_child_title_changed(parent);
+ container_notify_subtree_changed(parent);
return parent;
}
@@ -184,8 +184,8 @@ void container_move_to(struct sway_container *container,
container_sort_workspaces(new_parent);
seat_set_focus(seat, new_parent);
}
- container_notify_child_title_changed(old_parent);
- container_notify_child_title_changed(new_parent);
+ container_notify_subtree_changed(old_parent);
+ container_notify_subtree_changed(new_parent);
if (old_parent) {
if (old_parent->type == C_OUTPUT) {
arrange_output(old_parent);
@@ -499,8 +499,8 @@ void container_move(struct sway_container *container,
}
}
- container_notify_child_title_changed(old_parent);
- container_notify_child_title_changed(container->parent);
+ container_notify_subtree_changed(old_parent);
+ container_notify_subtree_changed(container->parent);
if (old_parent) {
seat_set_focus(config->handler_context.seat, old_parent);
@@ -588,11 +588,19 @@ static struct sway_container *get_swayc_in_output_direction(
if (ws->children->length > 0) {
switch (dir) {
case MOVE_LEFT:
- // get most right child of new output
- return ws->children->items[ws->children->length-1];
+ if (ws->layout == L_HORIZ || ws->layout == L_TABBED) {
+ // get most right child of new output
+ return ws->children->items[ws->children->length-1];
+ } else {
+ return seat_get_focus_inactive(seat, ws);
+ }
case MOVE_RIGHT:
- // get most left child of new output
- return ws->children->items[0];
+ if (ws->layout == L_HORIZ || ws->layout == L_TABBED) {
+ // get most left child of new output
+ return ws->children->items[0];
+ } else {
+ return seat_get_focus_inactive(seat, ws);
+ }
case MOVE_UP:
case MOVE_DOWN: {
struct sway_container *focused =
@@ -849,7 +857,7 @@ struct sway_container *container_split(struct sway_container *child,
container_add_child(cont, child);
}
- container_notify_child_title_changed(cont);
+ container_notify_subtree_changed(cont);
return cont;
}