aboutsummaryrefslogtreecommitdiff
path: root/src/draw.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/draw.c')
-rw-r--r--src/draw.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/draw.c b/src/draw.c
index 30f59a1..af5c493 100644
--- a/src/draw.c
+++ b/src/draw.c
@@ -66,19 +66,8 @@ void draw_paint(Drawable *draw, Window *win)
double degree = M_PI / 180.0;
+ // Fill the background
cairo_set_source_rgba(cr, draw->background.r, draw->background.g, draw->background.b, draw->background.a);
-
- // TODO: Here we should paint the shape of the bar, however there is a problem with the surface
- // painted in the pixmap to mask the window shape in window_paint_corners.
- //
- // This is caused by some difference between the two shapes (that should technically be the same)
- // which causes a mismatch between the two layers and leaves some black pixels visible
-
- //int radius = height / 2;
- //cairo_arc(cr, radius, radius, radius, 90.0 * degree, 270 * degree);
- //cairo_arc(cr, width - radius, radius, radius, 270 * degree, 450 * degree);
- //cairo_fill(cr);
-
cairo_paint(cr);
int line_w = draw->line_w * scale;
@@ -276,7 +265,7 @@ void draw_compute_layout(Drawable *draw, Window *win, GList *btns)
};
if (layout_end[PANGO_ALIGN_RIGHT] > width) {
- log_error("LENGHT %d on %d", layout_end[PANGO_ALIGN_RIGHT], width);
+ log_error("Layout is bigger than the window (%d vs %d)", layout_end[PANGO_ALIGN_RIGHT], width);
}
int center = round(width / 2);
@@ -288,7 +277,7 @@ void draw_compute_layout(Drawable *draw, Window *win, GList *btns)
layout->x += center_off;
}
- int right = width - layout_width[PANGO_ALIGN_LEFT];
+ int right = width - layout_width[PANGO_ALIGN_RIGHT];
// The width is off by 2 line width
int right_off = right - MAX(layout_end[PANGO_ALIGN_LEFT], layout_end[PANGO_ALIGN_CENTER]) + 2 * line_w;
log_debug("Aligning right layout [x=%d, off=%d]", right, right_off);