From: Michael Stapelberg Date: Sun, 8 Nov 2009 12:04:14 +0000 (+0100) Subject: Fix rendering of 1-px-border windows which require background filling X-Git-Tag: 3.d~8 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=316f62dfda001accddb6b1b834e6cb03628200e9;p=i3%2Fi3 Fix rendering of 1-px-border windows which require background filling --- diff --git a/src/handlers.c b/src/handlers.c index 8d1bd5ba..5b9ab8bc 100644 --- a/src/handlers.c +++ b/src/handlers.c @@ -753,8 +753,13 @@ int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t * /* Draw a black background */ xcb_change_gc_single(conn, client->titlegc, XCB_GC_FOREGROUND, get_colorpixel(conn, "#000000")); - xcb_rectangle_t crect = {2, 0, client->rect.width - (2 + 2), client->rect.height - 2}; - xcb_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect); + if (client->titlebar_position == TITLEBAR_OFF) { + xcb_rectangle_t crect = {1, 0, client->rect.width - (1 + 1), client->rect.height - 1}; + xcb_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect); + } else { + xcb_rectangle_t crect = {2, 0, client->rect.width - (2 + 2), client->rect.height - 2}; + xcb_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect); + } } xcb_flush(conn); return 1; diff --git a/src/layout.c b/src/layout.c index f04b6de3..24cafb72 100644 --- a/src/layout.c +++ b/src/layout.c @@ -174,9 +174,14 @@ void decorate_window(xcb_connection_t *conn, Client *client, xcb_drawable_t draw /* Draw the inner background to have a black frame around clients (such as mplayer) which cannot be resized exactly in our frames and therefore are centered */ xcb_change_gc_single(conn, client->titlegc, XCB_GC_FOREGROUND, get_colorpixel(conn, "#000000")); - xcb_rectangle_t crect = {2, decoration_height, - client->rect.width - (2 + 2), client->rect.height - 2 - decoration_height}; - xcb_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect); + if (client->titlebar_position == TITLEBAR_OFF) { + xcb_rectangle_t crect = {1, 1, client->rect.width - (1 + 1), client->rect.height - (1 + 1)}; + xcb_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect); + } else { + xcb_rectangle_t crect = {2, decoration_height, + client->rect.width - (2 + 2), client->rect.height - 2 - decoration_height}; + xcb_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect); + } } if (client->titlebar_position != TITLEBAR_OFF) {