From 083d1eed1f61f8cc7397031f1ab987022ba6868e Mon Sep 17 00:00:00 2001 From: taiyu Date: Sat, 15 Aug 2015 21:21:20 -0700 Subject: fixed 2 small memory leaks & adds format attribute to log. --- sway/layout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sway/layout.c') diff --git a/sway/layout.c b/sway/layout.c index 918da9f0..8cf88be3 100644 --- a/sway/layout.c +++ b/sway/layout.c @@ -215,10 +215,10 @@ swayc_t *get_swayc_for_handle(wlc_handle handle, swayc_t *parent) { } swayc_t *get_focused_container(swayc_t *parent) { - if (parent->focused == NULL) { - return parent; + while (parent->focused) { + parent = parent->focused; } - return get_focused_container(parent->focused); + return parent; } void unfocus_all(swayc_t *container) { -- cgit v1.2.3