diff options
| author | Federico Angelilli <code@fedang.net> | 2024-03-16 15:34:14 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-03-16 15:34:14 +0100 |
| commit | 40ca9598d269c9b6f162e80b5293f83ec37bb75d (patch) | |
| tree | 8e7e9627ca94fa87382d95fb83ee0f14385ff286 /src/draw.c | |
| parent | 15baf349fa6985262da39b70f2d496af104c478d (diff) | |
Refactor and fix a couple leaks
Diffstat (limited to 'src/draw.c')
| -rw-r--r-- | src/draw.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -202,7 +202,7 @@ static GList *compute_group_layout(Drawer *draw, Window *win, GList *btns, int b layout->x = bx; layout->y = 0; - // TODO: Allow nested groups +retry: if (!btn->simple) { ButtonGroup *group = CAST(btn, ButtonGroup); g_assert_nonnull(group->children); @@ -211,6 +211,7 @@ static GList *compute_group_layout(Drawer *draw, Window *win, GList *btns, int b if (group->children->next == NULL) { layout->btn = btn = group->children->data; g_assert_true(btn->simple); + goto retry; } else { layout->children = compute_group_layout(draw, win, group->children, bx, false); g_assert_nonnull(layout->children); @@ -231,11 +232,7 @@ static GList *compute_group_layout(Drawer *draw, Window *win, GList *btns, int b if (fix_right) layout->width -= 1; } - } - - // NOTE: This check is only apparently redundant because it handles the case where there - // there is only a single children in a group - if (btn->simple) { + } else { layout->pl = pango_cairo_create_layout(window_get_context(win)); layout_set_text(layout, draw->desc, draw->height); } |
