Don't draw borders wider than actual width
Patch status: merged
Patch by Mats
Long description:
Rectangles passed to function xcb_poly_fill_rectangle are of type xcb_rectangle_t and defined as: struct xcb_rectangle_t { int16_t x; int16_t y; uint16_t width; uint16_t height; } The rectangles for the right and lower border had a width and height, respectively, greater than the actual border width. Furthermore, offset the bottom border to not overlap with the right one and, for the top border, use r->width instead of con->rect.width as with the other borders.
To apply this patch, use:
curl http://cr.i3wm.org/patch/646/raw.patch | git am
b/src/x.c
29 |
@@ -430,16 +430,16 @@ void x_draw_decoration(Con *con) { |
30 |
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, &leftline); |
31 |
} |
32 |
if (!(borders_to_hide & ADJ_RIGHT_SCREEN_EDGE)) { |
33 |
- xcb_rectangle_t rightline = {r->width + br.width + br.x, 0, r->width, r->height}; |
34 |
+ xcb_rectangle_t rightline = {r->width + (br.width + br.x), 0, -(br.width + br.x), r->height}; |
35 |
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, &rightline); |
36 |
} |
37 |
if (!(borders_to_hide & ADJ_LOWER_SCREEN_EDGE)) { |
38 |
- xcb_rectangle_t bottomline = {0, r->height + br.height + br.y, r->width, r->height}; |
39 |
+ xcb_rectangle_t bottomline = {br.x, r->height + (br.height + br.y), r->width + br.width, -(br.height + br.y)}; |
40 |
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, &bottomline); |
41 |
} |
42 |
/* 1pixel border needs an additional line at the top */ |
43 |
if (p->border_style == BS_PIXEL && !(borders_to_hide & ADJ_UPPER_SCREEN_EDGE)) { |
44 |
- xcb_rectangle_t topline = {br.x, 0, con->rect.width + br.width + br.x, br.y}; |
45 |
+ xcb_rectangle_t topline = {br.x, 0, r->width + br.width, br.y}; |
46 |
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, &topline); |
47 |
} |
48 |
|
49 |
@@ -453,10 +453,10 @@ void x_draw_decoration(Con *con) { |
50 |
xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->indicator}); |
51 |
if (p->parent_layout == L_SPLITH) |
52 |
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]) { |
53 |
- {r->width + br.width + br.x, br.y, r->width, r->height + br.height}}); |
54 |
+ {r->width + (br.width + br.x), br.y, -(br.width + br.x), r->height + br.height}}); |
55 |
else if (p->parent_layout == L_SPLITV) |
56 |
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]) { |
57 |
- {br.x, r->height + br.height + br.y, r->width - (2 * br.x), r->height}}); |
58 |
+ {br.x, r->height + (br.height + br.y), r->width + br.width, -(br.height + br.y)}}); |
59 |
} |
60 |
} |
61 |
|