From: Michael Stapelberg Date: Sun, 14 Nov 2010 20:17:27 +0000 (+0100) Subject: Bugfix: use rectangles instead of a polygon to avoid strange rendering errors X-Git-Tag: tree-pr1~99 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d4017031352381c2d345d32a4a84a176a3b5fce8;p=i3%2Fi3 Bugfix: use rectangles instead of a polygon to avoid strange rendering errors With the polygon, when using pidgin, having the buddy list in the middle of the screen, 200 px width, full screen high, then opening the manage accounts window, the decorations of the buddy list were visible on the accounts window. --- diff --git a/src/x.c b/src/x.c index 41707bf7..fe83a848 100644 --- a/src/x.c +++ b/src/x.c @@ -256,23 +256,17 @@ void x_draw_decoration(Con *con) { DLOG("window_rect spans (%d, %d) with %d x %d\n", con->window_rect.x, con->window_rect.y, con->window_rect.width, con->window_rect.height); #endif - /* This polygon represents the border around the child window (left, - * bottom and right part). We don’t just fill the whole rectangle - * because some childs are not freely resizable and we want their - * background color to "shine through". */ + /* These rectangles represents the border around the child window + * (left, bottom and right part). We don’t just fill the whole + * rectangle because some childs are not freely resizable and we want + * their background color to "shine through". */ xcb_change_gc_single(conn, con->gc, XCB_GC_FOREGROUND, color->background); - xcb_point_t points[] = { - { 0, 0 }, - { 0, r->height }, - { r->width, r->height }, - { r->width, 0 }, - { r->width + br.width + br.x, 0 }, - { r->width + br.width + br.x, r->height + br.height + br.y }, - { br.x, r->height + br.height }, - { br.x, 0 } + xcb_rectangle_t borders[] = { + { 0, 0, br.x, r->height }, + { 0, r->height + br.height + br.y, r->width, r->height }, + { r->width + br.width + br.x, 0, r->width, r->height } }; - xcb_fill_poly(conn, con->frame, con->gc, XCB_POLY_SHAPE_COMPLEX, XCB_COORD_MODE_ORIGIN, 8, points); - + xcb_poly_fill_rectangle(conn, con->frame, con->gc, 3, borders); /* 1pixel border needs an additional line at the top */ if (border_style == BS_1PIXEL) { xcb_rectangle_t topline = { br.x, 0, con->rect.width + br.width + br.x, br.y };