From: Ingo Bürk Date: Wed, 13 Apr 2016 17:51:26 +0000 (+0200) Subject: Redraw right-hand side border correctly. X-Git-Tag: 4.13~91^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=057517b80935a39e1fde594001a3926b4f28d2fa;p=i3%2Fi3 Redraw right-hand side border correctly. Since we don't actually stop drawing a title (or marks) with the distance of the border width on the right side, but instead with a hard-coded two pixel distance, we can only redraw that much of the border without potentiall cutting off text. relates to #2247 --- diff --git a/src/x.c b/src/x.c index 5e50b4cd..a6e3bde9 100644 --- a/src/x.c +++ b/src/x.c @@ -327,14 +327,19 @@ static void x_draw_decoration_after_title(Con *con, struct deco_render_params *p assert(con->parent != NULL); Rect *dr = &(con->deco_rect); - Rect br = con_border_style_rect(con); /* Redraw the right border to cut off any text that went past it. * This is necessary when the text was drawn using XCB since cutting text off * automatically does not work there. For pango rendering, this isn't necessary. */ if (!font_is_pango()) { + /* We actually only redraw the far right two pixels as that is the + * distance we keep from the edge (not the entire border width). + * Redrawing the entire border would cause text to be cut off. */ draw_util_rectangle(conn, &(con->parent->frame_buffer), p->color->background, - dr->x + dr->width + br.width, dr->y, -br.width, dr->height); + dr->x + dr->width - 2 * logical_px(1), + dr->y, + 2 * logical_px(1), + dr->height); } /* Draw a 1px separator line before and after every tab, so that tabs can