aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar taiyu <taiyu.len@gmail.com>2015-08-28 22:51:36 -0700
committerLibravatar taiyu <taiyu.len@gmail.com>2015-08-28 22:51:36 -0700
commit19243991667d0a216b1014e8fe16503af6c11016 (patch)
treecbc60939d625a12cfe51490a7e55e4324ddb5afe
parentMerge pull request #147 from taiyu-len/master (diff)
downloadsway-19243991667d0a216b1014e8fe16503af6c11016.tar.gz
sway-19243991667d0a216b1014e8fe16503af6c11016.tar.zst
sway-19243991667d0a216b1014e8fe16503af6c11016.zip
#148 fix, choose non-floating view for inserting container
-rw-r--r--sway/handlers.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/sway/handlers.c b/sway/handlers.c
index 8b127d35..75f6a785 100644
--- a/sway/handlers.c
+++ b/sway/handlers.c
@@ -163,6 +163,18 @@ static bool handle_view_created(wlc_handle handle) {
163 } 163 }
164 if (!focused || focused->type == C_OUTPUT) { 164 if (!focused || focused->type == C_OUTPUT) {
165 focused = get_focused_container(&root_container); 165 focused = get_focused_container(&root_container);
166 // Move focus from floating view
167 if (focused->is_floating) {
168 // To workspace if there are no children
169 if (focused->parent->children->length == 0) {
170 focused = focused->parent;
171 }
172 // TODO find a better way of doing this
173 // Or to focused container
174 else {
175 focused = get_focused_container(focused->parent->children->items[0]);
176 }
177 }
166 } 178 }
167 sway_log(L_DEBUG, "handle:%ld type:%x state:%x parent:%ld " 179 sway_log(L_DEBUG, "handle:%ld type:%x state:%x parent:%ld "
168 "mask:%d (x:%d y:%d w:%d h:%d) title:%s " 180 "mask:%d (x:%d y:%d w:%d h:%d) title:%s "