From 529a6c2a8d5f787c0117a4b399e9e7d54d49f0e3 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 5 Jul 2021 18:08:06 -0700 Subject: [PATCH] wibar: Expose update_workarea. It is now possible to create wibars which are not changing the tiled area. --- lib/awful/wibar.lua | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/lib/awful/wibar.lua b/lib/awful/wibar.lua index 4a56be6b..7b326424 100644 --- a/lib/awful/wibar.lua +++ b/lib/awful/wibar.lua @@ -92,6 +92,14 @@ local align_map = { -- @beautiful beautiful.wibar_stretch -- @tparam boolean stretch +--- Allow or deny the tiled clients to cover the wibar. +-- +-- @property update_workarea +-- @tparam[opt=true] boolean update_workarea +-- @propemits true false +-- @see client.struts +-- @see screen.workarea + --- The wibar border width. -- @beautiful beautiful.wibar_border_width -- @tparam integer border_width @@ -219,7 +227,7 @@ end local function attach(wb, position) gen_placement(position, wb._private.align, wb._stretch)(wb, { attach = true, - update_workarea = true, + update_workarea = wb._private.update_workarea, margins = get_margins(wb) }) end @@ -319,6 +327,19 @@ function awfulwibar.set_stretch(w, value) end +function awfulwibar.get_update_workarea(w) + return w._private.update_workarea +end + +function awfulwibar.set_update_workarea(w, value) + w._private.update_workarea = value + + attach(w, w.position) + + w:emit_signal("property::update_workarea", value) +end + + function awfulwibar.set_margins(w, value) if type(value) == "number" then value = { @@ -541,6 +562,8 @@ function awfulwibar.new(args) } w._private.meta_margins = meta_margins(w) + w._private.update_workarea = true + -- `w` needs to be inserted in `wiboxes` before reattach or its own offset -- will not be taken into account by the "older" wibars when `reattach` is -- called. `skip_reattach` is required.