aboutsummaryrefslogtreecommitdiff
path: root/src/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.c')
-rw-r--r--src/draw.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/draw.c b/src/draw.c
index 609d96a..244a472 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -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);
}