From 146a9c3166081ab513533dee6183a396154165d7 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Mon, 25 Oct 2021 20:23:50 -0700 Subject: [PATCH] permission: Fix hiding the border for maximized clients. When the theme variables were moved to the backend instead of `rc.lua`, some magic was added to disable them if the user set the border. However, some undocumented `awful.placement` code also set them and turned off the theme variables. So it worked *once* then stopped working. --- lib/awful/permissions/init.lua | 10 ++++++++-- lib/awful/placement.lua | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/awful/permissions/init.lua b/lib/awful/permissions/init.lua index 11207b72e..64673d3f7 100644 --- a/lib/awful/permissions/init.lua +++ b/lib/awful/permissions/init.lua @@ -631,10 +631,16 @@ function permissions.update_border(c, context) end if not c._private._user_border_width then - c._border_width = beautiful["border_width"..suffix] + local bw = beautiful["border_width"..suffix] or beautiful["border_width"..fallback1] or beautiful["border_width"..fallback2] - or beautiful.border_width + + -- The default `awful.permissions.geometry` handler removes the border. + if (not bw) and (c.fullscreen or c.maximized) then + bw = 0 + end + + c._border_width = bw or beautiful.border_width end if not c._private._user_border_color then diff --git a/lib/awful/placement.lua b/lib/awful/placement.lua index d57b817e9..f25569a69 100644 --- a/lib/awful/placement.lua +++ b/lib/awful/placement.lua @@ -383,7 +383,7 @@ end area_common = function(d, new_geo, ignore_border_width, args) -- The C side expect no arguments, nil isn't valid if new_geo and args.zap_border_width then - d.border_width = 0 + d._border_width = 0 end local geometry = new_geo and d:geometry(new_geo) or d:geometry() local border = ignore_border_width and 0 or d.border_width or 0 @@ -1633,7 +1633,7 @@ function placement.restore(d, args) end - d.border_width = memento.border_width + d._border_width = memento.border_width -- Don't use the memento as it would be "destructive", since `x`, `y` -- and `screen` have to be modified.