- xcb_rectangle_t background[] = {
- /* top area */
- {0, 0, r->width, w->y},
- /* bottom area */
- {0, (w->y + w->height), r->width, r->height - (w->y + w->height)},
- /* left area */
- {0, 0, w->x, r->height},
- /* right area */
- {w->x + w->width, 0, r->width - (w->x + w->width), r->height}};
-#if 0
- for (int i = 0; i < 4; i++)
- DLOG("rect is (%d, %d) with %d x %d\n",
- background[i].x,
- background[i].y,
- background[i].width,
- background[i].height
- );
-#endif
-
- xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){config.client.background});
- xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, sizeof(background) / sizeof(xcb_rectangle_t), background);
+ /* top area */
+ draw_util_rectangle(&(con->frame_buffer), config.client.background,
+ 0, 0, r->width, w->y);
+ /* bottom area */
+ draw_util_rectangle(&(con->frame_buffer), config.client.background,
+ 0, w->y + w->height, r->width, r->height - (w->y + w->height));
+ /* left area */
+ draw_util_rectangle(&(con->frame_buffer), config.client.background,
+ 0, 0, w->x, r->height);
+ /* right area */
+ draw_util_rectangle(&(con->frame_buffer), config.client.background,
+ w->x + w->width, 0, r->width - (w->x + w->width), r->height);