aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authortaiyu <taiyu.len@gmail.com>2015-08-26 16:27:01 -0700
committertaiyu <taiyu.len@gmail.com>2015-08-26 16:27:01 -0700
commit274e56a60256214d1f899c37f1c978e4b8470644 (patch)
treee0f7f77e41abd84da02208d7a09b610411c58fbb /sway/layout.c
parenteb53f173c5cc3739149b3fafc50ab55d5503a649 (diff)
fixed move_container bug, log prints before aborting
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 72d3de77..4fdf7b51 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -130,6 +130,7 @@ swayc_t *remove_child(swayc_t *child) {
parent->focused = NULL;
}
}
+ child->parent = NULL;
// deactivate view
if (child->type == C_VIEW) {
wlc_view_set_state(child->handle, WLC_BIT_ACTIVATED, false);
@@ -219,7 +220,7 @@ void move_container(swayc_t *container,swayc_t* root,enum movement_direction dir
}
void move_container_to(swayc_t* container, swayc_t* destination) {
- if (container->parent == destination) {
+ if (container == destination) {
return;
}
swayc_t *parent = remove_child(container);
@@ -236,8 +237,10 @@ void move_container_to(swayc_t* container, swayc_t* destination) {
}
// Destroy old container if we need to
parent = destroy_container(parent);
+ // Refocus
set_focused_container(get_focused_view(&root_container));
update_visibility(container);
+ update_visibility(parent);
arrange_windows(parent, -1, -1);
arrange_windows(destination->parent, -1, -1);
}