From 76c07900c279942f3bfae6cc0ecea7bb751c38e9 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 14 Nov 2010 23:44:13 +0100 Subject: [PATCH] take into account x11 border_width settings (fixes uxterm border issue) --- include/data.h | 3 +++ src/manage.c | 2 ++ src/render.c | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/include/data.h b/include/data.h index d34fd733..cc9fca1d 100644 --- a/include/data.h +++ b/include/data.h @@ -297,6 +297,9 @@ struct Con { int base_width; int base_height; + /* the x11 border pixel attribute */ + int border_width; + /* minimum increment size specified for the window (in pixels) */ int width_increment; int height_increment; diff --git a/src/manage.c b/src/manage.c index d0ecf1eb..548e5da7 100644 --- a/src/manage.c +++ b/src/manage.c @@ -185,6 +185,8 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki nc->window = cwindow; x_reinit(nc); + nc->border_width = geom->border_width; + char *name; asprintf(&name, "[i3 con] container around %p", cwindow); x_set_name(nc, name); diff --git a/src/render.c b/src/render.c index ddb3751a..f8305d54 100644 --- a/src/render.c +++ b/src/render.c @@ -51,6 +51,10 @@ void render_con(Con *con) { *inset = (Rect){0, 0, con->rect.width, con->rect.height}; *inset = rect_add(*inset, con_border_style_rect(con)); + /* Obey x11 border */ + inset->width -= (2 * con->border_width); + inset->height -= (2 * con->border_width); + /* Obey the aspect ratio, if any */ if (con->proportional_height != 0 && con->proportional_width != 0) { -- 2.39.5