wibox: add property hook on screen and visible changes
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
f4e77bcab9
commit
0c564079b5
|
@ -13,6 +13,7 @@ local ipairs = ipairs
|
|||
local table = table
|
||||
local math = math
|
||||
local setmetatable = setmetatable
|
||||
local type = type
|
||||
local capi =
|
||||
{
|
||||
client = client,
|
||||
|
@ -575,7 +576,7 @@ hooks.manage.register(function (c)
|
|||
end)
|
||||
|
||||
hooks.property.register(function (c, prop)
|
||||
if prop == "geometry" and floating.get(c) then
|
||||
if type(c) == "client" and prop == "geometry" and floating.get(c) then
|
||||
property.set(c, "floating_geometry", c:geometry())
|
||||
end
|
||||
end)
|
||||
|
|
|
@ -10,6 +10,7 @@ local image = image
|
|||
local pairs = pairs
|
||||
local type = type
|
||||
local setmetatable = setmetatable
|
||||
local type = type
|
||||
local capi =
|
||||
{
|
||||
wibox = wibox,
|
||||
|
|
8
wibox.c
8
wibox.c
|
@ -605,7 +605,10 @@ wibox_setvisible(wibox_t *wibox, bool v)
|
|||
/* All the other wibox and ourselves need to be repositioned */
|
||||
foreach(w, wibox->screen->wiboxes)
|
||||
wibox_position_update(*w);
|
||||
|
||||
}
|
||||
|
||||
hook_property(wibox, wibox, "visible");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -640,7 +643,10 @@ wibox_detach(wibox_t *wibox)
|
|||
break;
|
||||
}
|
||||
|
||||
hook_property(wibox, wibox, "screen");
|
||||
|
||||
wibox->screen = NULL;
|
||||
|
||||
wibox_unref(globalconf.L, wibox);
|
||||
}
|
||||
}
|
||||
|
@ -694,6 +700,8 @@ wibox_attach(screen_t *s)
|
|||
wibox_map(wibox);
|
||||
else
|
||||
wibox_need_update(wibox);
|
||||
|
||||
hook_property(wibox, wibox, "screen");
|
||||
}
|
||||
|
||||
/** Create a new wibox.
|
||||
|
|
Loading…
Reference in New Issue