diff options
author | taiyu <taiyu.len@gmail.com> | 2015-08-26 16:50:47 -0700 |
---|---|---|
committer | taiyu <taiyu.len@gmail.com> | 2015-08-26 16:50:47 -0700 |
commit | 4df64127e951cb6f13d65fc667c10ffc0f4a4dbd (patch) | |
tree | 23a2689b9f15d52d3d8893743671f0fd30586698 /sway/layout.c | |
parent | fixed move_container bug, log prints before aborting (diff) | |
download | sway-4df64127e951cb6f13d65fc667c10ffc0f4a4dbd.tar.gz sway-4df64127e951cb6f13d65fc667c10ffc0f4a4dbd.tar.zst sway-4df64127e951cb6f13d65fc667c10ffc0f4a4dbd.zip |
slight fix
Diffstat (limited to 'sway/layout.c')
-rw-r--r-- | sway/layout.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sway/layout.c b/sway/layout.c index 4fdf7b51..5ade5e63 100644 --- a/sway/layout.c +++ b/sway/layout.c | |||
@@ -19,6 +19,7 @@ void init_layout(void) { | |||
19 | root_container.layout = L_NONE; | 19 | root_container.layout = L_NONE; |
20 | root_container.children = create_list(); | 20 | root_container.children = create_list(); |
21 | root_container.handle = -1; | 21 | root_container.handle = -1; |
22 | root_container.visible = true; | ||
22 | } | 23 | } |
23 | 24 | ||
24 | int index_child(const swayc_t *child) { | 25 | int index_child(const swayc_t *child) { |
@@ -238,11 +239,16 @@ void move_container_to(swayc_t* container, swayc_t* destination) { | |||
238 | // Destroy old container if we need to | 239 | // Destroy old container if we need to |
239 | parent = destroy_container(parent); | 240 | parent = destroy_container(parent); |
240 | // Refocus | 241 | // Refocus |
241 | set_focused_container(get_focused_view(&root_container)); | 242 | swayc_t *op1 = swayc_parent_by_type(destination, C_OUTPUT); |
242 | update_visibility(container); | 243 | swayc_t *op2 = swayc_parent_by_type(parent, C_OUTPUT); |
243 | update_visibility(parent); | 244 | set_focused_container(get_focused_view(op1)); |
244 | arrange_windows(parent, -1, -1); | 245 | arrange_windows(op1, -1, -1); |
245 | arrange_windows(destination->parent, -1, -1); | 246 | update_visibility(op1); |
247 | if (op1 != op2) { | ||
248 | set_focused_container(get_focused_view(op2)); | ||
249 | arrange_windows(op2, -1, -1); | ||
250 | update_visibility(op2); | ||
251 | } | ||
246 | } | 252 | } |
247 | 253 | ||
248 | void update_geometry(swayc_t *container) { | 254 | void update_geometry(swayc_t *container) { |