From cb12e205d9cb9e87ff4095d7aa3ae2cfe8328991 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Fri, 12 Jun 2009 22:55:56 +0200 Subject: [PATCH] =?utf8?q?Bugfix:=20When=20toggling=20floating,=20the=20co?= =?utf8?q?pied=20size=20is=20the=20client=E2=80=99s=20size,=20not=20the=20?= =?utf8?q?total=20size?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/floating.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/floating.c b/src/floating.c index 181fbe34..6a2d8218 100644 --- a/src/floating.c +++ b/src/floating.c @@ -18,6 +18,7 @@ #include #include "i3.h" +#include "config.h" #include "data.h" #include "util.h" #include "xcb.h" @@ -45,6 +46,7 @@ static void drag_pointer(xcb_connection_t *conn, Client *client, xcb_button_pres */ void toggle_floating_mode(xcb_connection_t *conn, Client *client, bool automatic) { Container *con = client->container; + i3Font *font = load_font(conn, config.font); if (con == NULL) { LOG("This client is already in floating (container == NULL), re-inserting\n"); @@ -103,8 +105,11 @@ void toggle_floating_mode(xcb_connection_t *conn, Client *client, bool automatic client->floating_rect.y = client->rect.y; /* Copy the size the other direction */ - client->rect.width = client->floating_rect.width; - client->rect.height = client->floating_rect.height; + client->child_rect.width = client->floating_rect.width; + client->child_rect.height = client->floating_rect.height; + + client->rect.width = client->child_rect.width + 2 + 2; + client->rect.height = client->child_rect.height + (font->height + 2 + 2) + 2; LOG("copying size from tiling (%d, %d) size (%d, %d)\n", client->floating_rect.x, client->floating_rect.y, client->floating_rect.width, client->floating_rect.height); -- 2.39.5