Bugfix: Redraw right border after rendering the window title (Thanks fernandotcl)

Fixes #368
This commit is contained in:
Michael Stapelberg 2012-01-21 10:59:23 +00:00
parent 1d5071ebbe
commit 1784b3858d
1 changed files with 17 additions and 1 deletions

18
src/x.c
View File

@ -384,7 +384,7 @@ void x_draw_decoration(Con *con) {
}
}
/* if this is a borderless/1pixel window, we dont * need to render the
/* if this is a borderless/1pixel window, we dont need to render the
* decoration. */
if (p->border_style != BS_NORMAL)
goto copy_pixmaps;
@ -443,6 +443,22 @@ void x_draw_decoration(Con *con) {
con->deco_rect.x + 2 + indent_px, con->deco_rect.y + text_offset_y,
con->deco_rect.width - 2 - indent_px);
/* Since we dont clip the text at all, it might in some cases be painted
* on the border pixels on the right side of a window. Therefore, we draw
* the right border again after rendering the text (and the unconnected
* lines in border color). */
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){ p->color->background });
xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, parent->pixmap, parent->pm_gc, 4,
(xcb_point_t[]){
{ dr->x + dr->width - 1, dr->y },
{ dr->x + dr->width - 1, dr->y + dr->height },
{ dr->x + dr->width - 2, dr->y },
{ dr->x + dr->width - 2, dr->y + dr->height }
});
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){ p->color->border });
xcb_poly_segment(conn, parent->pixmap, parent->pm_gc, 2, segments);
copy_pixmaps:
xcb_copy_area(conn, con->pixmap, con->frame, con->pm_gc, 0, 0, 0, 0, con->rect.width, con->rect.height);
}