From 630ef295a1d26ef571486fa7cbbdbe236ac44c01 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Wed, 10 Dec 2008 21:07:34 +0100 Subject: [PATCH] titlebar: resize client when adding/removing so total size remains the same Signed-off-by: Maarten Maathuis Signed-off-by: Julien Danjou --- lib/awful/titlebar.lua.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/awful/titlebar.lua.in b/lib/awful/titlebar.lua.in index bfacf4f4b..93b892703 100644 --- a/lib/awful/titlebar.lua.in +++ b/lib/awful/titlebar.lua.in @@ -112,8 +112,14 @@ function add(c, args) tb.widgets = { appicon = appicon, title = title, closef = closef, close = close } + -- Store old geometry (including borders) + local old_geom = c:fullgeometry() + c.titlebar = tb + -- Resize the client so the same amount of space is occupied as before. + c:fullgeometry(old_geom) + update(c) update(c, "geometry") end @@ -161,8 +167,11 @@ end --- Remove a titlebar from a client. -- @param c The client. function remove(c) + local old_geom = c:fullgeometry() c.titlebar = nil data[c] = nil + -- Resize the client so the same amount of space is occupied as before. + c:fullgeometry(old_geom) end -- Register standards hooks