Use master window factor in offset calculation deck layout (#216)

This commit is contained in:
Woynert 2023-09-03 10:34:28 -05:00 committed by GitHub
parent 01944af235
commit 1f6bd0d5ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -5,6 +5,7 @@ mylayout.name = "deck"
function mylayout.arrange(p)
local area = p.workarea
local t = p.tag or screen[p.screen].selected_tag
local mwfact = t.master_width_factor
local client_count = #p.clients
if client_count == 1 then
@ -19,8 +20,8 @@ function mylayout.arrange(p)
return
end
local xoffset = area.width * 0.1 / (client_count - 1)
local yoffset = area.height * 0.1 / (client_count - 1)
local xoffset = area.width * 0.5 * (1 - mwfact) / (client_count - 1)
local yoffset = area.height * 0.5 * (1 - mwfact) / (client_count - 1)
for idx = 1, client_count do
local c = p.clients[idx]