x_set_name(nc, name);
free(name);
+ /* find the height for the decorations */
+ i3Font *font = load_font(conn, config.font);
+ int deco_height = font->height + 5;
+
nc->rect = con->rect;
/* add pixels for the decoration */
/* TODO: don’t add them when the user automatically puts new windows into
* 1pixel/borderless mode */
- nc->rect.height += 17 + 2;
+ nc->rect.height += deco_height + 4;
nc->rect.width += 4;
nc->orientation = NO_ORIENTATION;
nc->type = CT_FLOATING_CON;
DLOG("Configure request!\n");
if (con_is_floating(con) && con_is_leaf(con)) {
+ /* find the height for the decorations */
+ i3Font *font = load_font(conn, config.font);
+ int deco_height = font->height + 5;
/* we actually need to apply the size/position changes to the *parent*
* container */
Rect bsr = con_border_style_rect(con);
if (con->border_style == BS_NORMAL)
- bsr.height -= 17;
+ bsr.height -= deco_height;
con = con->parent;
DLOG("Container is a floating leaf node, will do that.\n");
if (event->value_mask & XCB_CONFIG_WINDOW_X) {
return;
}
+ /* find the height for the decorations */
+ i3Font *font = load_font(conn, config.font);
+ int deco_height = font->height + 5;
+
Con *child;
TAILQ_FOREACH(child, &(con->nodes_head), nodes) {
child->deco_rect.x = child->rect.x - con->rect.x;
child->deco_rect.y = child->rect.y - con->rect.y;
- child->rect.y += 17;
- child->rect.height -= 17;
+ child->rect.y += deco_height;
+ child->rect.height -= deco_height;
child->deco_rect.width = child->rect.width;
- child->deco_rect.height = 17;
+ child->deco_rect.height = deco_height;
}
}
child->rect.width = rect.width;
child->rect.height = rect.height;
- child->rect.y += (17 * children);
- child->rect.height -= (17 * children);
+ child->rect.y += (deco_height * children);
+ child->rect.height -= (deco_height * children);
child->deco_rect.x = x - con->rect.x;
- child->deco_rect.y = y - con->rect.y + (i * 17);
+ child->deco_rect.y = y - con->rect.y + (i * deco_height);
child->deco_rect.width = child->rect.width;
- child->deco_rect.height = 17;
+ child->deco_rect.height = deco_height;
}
printf("child at (%d, %d) with (%d x %d)\n",