aboutsummaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2015-08-25 16:39:16 -0400
committerDrew DeVault <sir@cmpwn.com>2015-08-25 16:39:16 -0400
commit77dcf70a9b9037f7582718c37b4dff04324d8c7a (patch)
tree3099d9e4b4f1b2491bfc0e93d9976e4e8161fd89 /sway/layout.c
parent0bf380a0b1a83f49e2e33066ab6504d308dcec89 (diff)
parent225c2fbe5b9219fd848c2d6d11cadef9ef1b42f0 (diff)
Merge pull request #132 from taiyu-len/master
fixed segfault on exit + a little fixup of that floatfocus pr
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sway/layout.c b/sway/layout.c
index cd47037b..ed9479ab 100644
--- a/sway/layout.c
+++ b/sway/layout.c
@@ -151,7 +151,9 @@ swayc_t *remove_child(swayc_t *child) {
// Set focused to new container
if (parent->focused == child) {
if (parent->children->length > 0) {
- parent->focused = parent->children->items[i?i-1:0];
+ parent->focused = parent->children->items[i ? i-1:0];
+ } else if (parent->floating && parent->floating->length) {
+ parent->focused = parent->floating->items[parent->floating->length - 1];
} else {
parent->focused = NULL;
}