From 225c2fbe5b9219fd848c2d6d11cadef9ef1b42f0 Mon Sep 17 00:00:00 2001 From: taiyu Date: Tue, 25 Aug 2015 13:29:33 -0700 Subject: fixed segfault on exit + a little fixup of that floatfocus pr --- sway/layout.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sway/layout.c') 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; } -- cgit v1.2.3