Only use useless_gap with multiple tiled clients
Fixes https://github.com/awesomeWM/awesome/issues/564. Closes https://github.com/awesomeWM/awesome/pull/568.
This commit is contained in:
parent
6ca85af53b
commit
269bb90e18
|
@ -121,7 +121,7 @@ function layout.arrange(screen)
|
||||||
|
|
||||||
local p = {}
|
local p = {}
|
||||||
p.workarea = capi.screen[screen].workarea
|
p.workarea = capi.screen[screen].workarea
|
||||||
local useless_gap = tag.getgap(tag.selected(screen))
|
local useless_gap = tag.getgap(tag.selected(screen), #client.tiled(s))
|
||||||
-- Handle padding
|
-- Handle padding
|
||||||
local padding = ascreen.padding(capi.screen[screen]) or {}
|
local padding = ascreen.padding(capi.screen[screen]) or {}
|
||||||
p.workarea.x = p.workarea.x + (padding.left or 0) + useless_gap
|
p.workarea.x = p.workarea.x + (padding.left or 0) + useless_gap
|
||||||
|
|
|
@ -407,10 +407,16 @@ function tag.incgap(add, t)
|
||||||
tag.setgap(tag.getgap(t) + add, t)
|
tag.setgap(tag.getgap(t) + add, t)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the spacing between clients
|
--- Get the spacing between clients.
|
||||||
-- @param t Optional tag.
|
-- @tparam[opt=tag.selected()] tag t The tag.
|
||||||
function tag.getgap(t)
|
-- @tparam[opt] int numclients Number of (tiled) clients. Passing this will
|
||||||
|
-- return 0 for a single client. You can override this function to change
|
||||||
|
-- this behavior.
|
||||||
|
function tag.getgap(t, numclients)
|
||||||
local t = t or tag.selected()
|
local t = t or tag.selected()
|
||||||
|
if numclients == 1 then
|
||||||
|
return 0
|
||||||
|
end
|
||||||
return tag.getproperty(t, "useless_gap") or beautiful.useless_gap or 0
|
return tag.getproperty(t, "useless_gap") or beautiful.useless_gap or 0
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue