titlebar: remove some old/unneeded code
- This fixes the resize upon titlebar removal issue. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
a47d0d9924
commit
247852f4de
|
@ -120,7 +120,6 @@ function add(c, args)
|
||||||
c.titlebar = tb
|
c.titlebar = tb
|
||||||
|
|
||||||
update(c)
|
update(c)
|
||||||
update(c, "geometry")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Update a titlebar. This should be called in some hooks.
|
--- Update a titlebar. This should be called in some hooks.
|
||||||
|
@ -137,17 +136,6 @@ function update(c, prop)
|
||||||
if widgets.appicon then
|
if widgets.appicon then
|
||||||
widgets.appicon.image = c.icon
|
widgets.appicon.image = c.icon
|
||||||
end
|
end
|
||||||
elseif prop == "geometry" then
|
|
||||||
if data[c].width then
|
|
||||||
if c.titlebar.position == "top"
|
|
||||||
or c.titlebar.position == "bottom" then
|
|
||||||
local w = math.min(data[c].width, c:geometry().width)
|
|
||||||
c.titlebar:geometry({ width = w })
|
|
||||||
else
|
|
||||||
local w = math.min(data[c].width, c:geometry().height)
|
|
||||||
c.titlebar:geometry({ height = w })
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
if capi.client.focus == c then
|
if capi.client.focus == c then
|
||||||
c.titlebar.fg = data[c].fg_focus
|
c.titlebar.fg = data[c].fg_focus
|
||||||
|
@ -166,11 +154,8 @@ end
|
||||||
--- Remove a titlebar from a client.
|
--- Remove a titlebar from a client.
|
||||||
-- @param c The client.
|
-- @param c The client.
|
||||||
function remove(c)
|
function remove(c)
|
||||||
local old_geom = c:geometry()
|
|
||||||
c.titlebar = nil
|
c.titlebar = nil
|
||||||
data[c] = nil
|
data[c] = nil
|
||||||
-- Resize the client so the same amount of space is occupied as before.
|
|
||||||
c:geometry(old_geom)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Register standards hooks
|
-- Register standards hooks
|
||||||
|
|
Loading…
Reference in New Issue