aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-26 16:27:01 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-26 16:27:01 -0700
commit274e56a60256214d1f899c37f1c978e4b8470644 (patch)
treee0f7f77e41abd84da02208d7a09b610411c58fbb
parentMerge pull request #137 from minus7/json (diff)
downloadsway-274e56a60256214d1f899c37f1c978e4b8470644.tar.gz
sway-274e56a60256214d1f899c37f1c978e4b8470644.tar.zst
sway-274e56a60256214d1f899c37f1c978e4b8470644.zip
fixed move_container bug, log prints before aborting
-rw-r--r--sway/layout.c5
-rw-r--r--sway/log.c8
2 files changed, 8 insertions, 5 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) {
130 parent->focused = NULL; 130 parent->focused = NULL;
131 } 131 }
132 } 132 }
133 child->parent = NULL;
133 // deactivate view 134 // deactivate view
134 if (child->type == C_VIEW) { 135 if (child->type == C_VIEW) {
135 wlc_view_set_state(child->handle, WLC_BIT_ACTIVATED, false); 136 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
219} 220}
220 221
221void move_container_to(swayc_t* container, swayc_t* destination) { 222void move_container_to(swayc_t* container, swayc_t* destination) {
222 if (container->parent == destination) { 223 if (container == destination) {
223 return; 224 return;
224 } 225 }
225 swayc_t *parent = remove_child(container); 226 swayc_t *parent = remove_child(container);
@@ -236,8 +237,10 @@ void move_container_to(swayc_t* container, swayc_t* destination) {
236 } 237 }
237 // Destroy old container if we need to 238 // Destroy old container if we need to
238 parent = destroy_container(parent); 239 parent = destroy_container(parent);
240 // Refocus
239 set_focused_container(get_focused_view(&root_container)); 241 set_focused_container(get_focused_view(&root_container));
240 update_visibility(container); 242 update_visibility(container);
243 update_visibility(parent);
241 arrange_windows(parent, -1, -1); 244 arrange_windows(parent, -1, -1);
242 arrange_windows(destination->parent, -1, -1); 245 arrange_windows(destination->parent, -1, -1);
243} 246}
diff --git a/sway/log.c b/sway/log.c
index 66898a28..efe00439 100644
--- a/sway/log.c
+++ b/sway/log.c
@@ -105,15 +105,15 @@ bool _sway_assert(bool condition, const char* format, ...) {
105 return true; 105 return true;
106 } 106 }
107 107
108#ifndef NDEBUG
109 raise(SIGABRT);
110#endif
111
112 va_list args; 108 va_list args;
113 va_start(args, format); 109 va_start(args, format);
114 sway_log(L_ERROR, format, args); 110 sway_log(L_ERROR, format, args);
115 va_end(args); 111 va_end(args);
116 112
113#ifndef NDEBUG
114 raise(SIGABRT);
115#endif
116
117 return false; 117 return false;
118} 118}
119 119