aboutsummaryrefslogtreecommitdiff
path: root/sway/tree
diff options
context:
space:
mode:
Diffstat (limited to 'sway/tree')
-rw-r--r--sway/tree/container.c4
-rw-r--r--sway/tree/layout.c15
2 files changed, 9 insertions, 10 deletions
diff --git a/sway/tree/container.c b/sway/tree/container.c
index d0d26631..ca993c41 100644
--- a/sway/tree/container.c
+++ b/sway/tree/container.c
@@ -255,7 +255,6 @@ static struct sway_container *container_output_destroy(
}
}
- wl_list_remove(&output->sway_output->destroy.link);
wl_list_remove(&output->sway_output->mode.link);
wl_list_remove(&output->sway_output->transform.link);
wl_list_remove(&output->sway_output->scale.link);
@@ -263,8 +262,7 @@ static struct sway_container *container_output_destroy(
wl_list_remove(&output->sway_output->damage_destroy.link);
wl_list_remove(&output->sway_output->damage_frame.link);
- // clear the wlr_output reference to this container
- output->sway_output->wlr_output->data = NULL;
+ output->sway_output->swayc = NULL;
wlr_log(L_DEBUG, "OUTPUT: Destroying output '%s'", output->name);
_container_destroy(output);
diff --git a/sway/tree/layout.c b/sway/tree/layout.c
index 79e7c87e..b54dc2fe 100644
--- a/sway/tree/layout.c
+++ b/sway/tree/layout.c
@@ -35,6 +35,7 @@ void layout_init(void) {
root_container.sway_root = calloc(1, sizeof(*root_container.sway_root));
root_container.sway_root->output_layout = wlr_output_layout_create();
+ wl_list_init(&root_container.sway_root->outputs);
wl_list_init(&root_container.sway_root->xwayland_unmanaged);
wl_signal_init(&root_container.sway_root->events.new_container);
@@ -874,11 +875,10 @@ struct sway_container *container_split(struct sway_container *child,
cont->x = child->x;
cont->y = child->y;
+ struct sway_seat *seat = input_manager_get_default_seat(input_manager);
+ bool set_focus = (seat_get_focus(seat) == child);
if (child->type == C_WORKSPACE) {
- struct sway_seat *seat = input_manager_get_default_seat(input_manager);
struct sway_container *workspace = child;
- bool set_focus = (seat_get_focus(seat) == workspace);
-
while (workspace->children->length) {
struct sway_container *ws_child = workspace->children->items[0];
container_remove_child(ws_child);
@@ -890,10 +890,6 @@ struct sway_container *container_split(struct sway_container *child,
enum sway_container_layout old_layout = workspace->layout;
workspace->layout = layout;
cont->layout = old_layout;
-
- if (set_focus) {
- seat_set_focus(seat, cont);
- }
} else {
struct sway_container *old_parent = child->parent;
cont->layout = layout;
@@ -902,6 +898,11 @@ struct sway_container *container_split(struct sway_container *child,
wl_signal_emit(&child->events.reparent, old_parent);
}
+ if (set_focus) {
+ seat_set_focus(seat, cont);
+ seat_set_focus(seat, child);
+ }
+
container_notify_subtree_changed(cont);
return cont;