diff options
| author | Federico Angelilli <code@fedang.net> | 2024-02-08 12:40:56 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-02-08 12:40:56 +0100 |
| commit | a81b8b36afad38e93ab2051e26d21d6125a46eca (patch) | |
| tree | cfa3ff11138783f7a85c6658a3f3284269e9a366 /src/draw.c | |
| parent | 09505cb480274bdc154c1b4ae3dd6988e56b4368 (diff) | |
Add dwm tags
Diffstat (limited to 'src/draw.c')
| -rw-r--r-- | src/draw.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -260,6 +260,8 @@ void draw_compute_layout(Drawable *draw, Window *win, GList *btns) draw->layouts = g_list_reverse(draw->layouts); + // FIXME: BUG! Explodes if the buttons are not loaded with the left first!!! + int layout_width[3] = { layout_end[PANGO_ALIGN_LEFT], layout_end[PANGO_ALIGN_CENTER] - layout_end[PANGO_ALIGN_LEFT], @@ -274,7 +276,7 @@ void draw_compute_layout(Drawable *draw, Window *win, GList *btns) int center_off = center - round(layout_width[PANGO_ALIGN_CENTER] / 2) - layout_end[PANGO_ALIGN_LEFT]; log_debug("Aligning center layout [center=%d, off=%d]", center, center_off); - for (GList *it = layout_start[PANGO_ALIGN_CENTER]; it != layout_start[PANGO_ALIGN_RIGHT]; it = it->next) { + for (GList *it = layout_start[PANGO_ALIGN_CENTER]; it != NULL && it != layout_start[PANGO_ALIGN_RIGHT]; it = it->next) { Layout *layout = it->data; layout->x += center_off; } |
