Fix rendering of 1-px-border windows which require background filling

This commit is contained in:
Michael Stapelberg 2009-11-08 13:04:14 +01:00
parent f1ecf08df5
commit 316f62dfda
2 changed files with 15 additions and 5 deletions

View File

@ -753,9 +753,14 @@ int handle_expose_event(void *data, xcb_connection_t *conn, xcb_expose_event_t *
/* Draw a black background */ /* Draw a black background */
xcb_change_gc_single(conn, client->titlegc, XCB_GC_FOREGROUND, get_colorpixel(conn, "#000000")); xcb_change_gc_single(conn, client->titlegc, XCB_GC_FOREGROUND, get_colorpixel(conn, "#000000"));
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_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_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect);
} }
}
xcb_flush(conn); xcb_flush(conn);
return 1; return 1;
} }

View File

@ -174,10 +174,15 @@ 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) /* 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 */ 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_change_gc_single(conn, client->titlegc, XCB_GC_FOREGROUND, get_colorpixel(conn, "#000000"));
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, xcb_rectangle_t crect = {2, decoration_height,
client->rect.width - (2 + 2), client->rect.height - 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); xcb_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect);
} }
}
if (client->titlebar_position != TITLEBAR_OFF) { if (client->titlebar_position != TITLEBAR_OFF) {
/* Draw the lines */ /* Draw the lines */