titlebar: resize client when adding/removing so total size remains the same
Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
f655e8bcf4
commit
630ef295a1
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue