summaryrefslogtreecommitdiff
path: root/sway/layout.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2015-08-16 08:10:56 -0400
committerDrew DeVault <[email protected]>2015-08-16 08:10:56 -0400
commitae536c21d3bcab7758f4a47cbf4556c518245a7b (patch)
treecc8ffeb1d52d770548fd99a9d0b7bbef18f90ead /sway/layout.c
parent76ec9422a66c4ff59dc0590d80f7f6e931fd8e1a (diff)
Revert "get/set_userdata stores swayc_t *, fixed memory leak, minor changes."
Diffstat (limited to 'sway/layout.c')
-rw-r--r--sway/layout.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/layout.c b/sway/layout.c
index 8cf88be3..918da9f0 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) {
- while (parent->focused) {
- parent = parent->focused;
+ if (parent->focused == NULL) {
+ return parent;
}
- return parent;
+ return get_focused_container(parent->focused);
}
void unfocus_all(swayc_t *container) {