fixed segfault on exit + a little fixup of that floatfocus pr

This commit is contained in:
taiyu 2015-08-25 13:29:33 -07:00
parent 0bf380a0b1
commit 225c2fbe5b
5 changed files with 24 additions and 17 deletions

View file

@ -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;
}