- 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 && client->borderless) {
+ xcb_rectangle_t crect = {0, 0, client->rect.width, client->rect.height};
+ xcb_poly_fill_rectangle(conn, client->frame, client->titlegc, 1, &crect);
+ } else if (client->titlebar_position == TITLEBAR_OFF && !client->borderless) {
+ 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);
+ }