From a3542c638a69fe4f20384a574635b362ad58358f Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sat, 26 Mar 2016 03:22:20 -0400 Subject: [PATCH] awful.layout: Use awful.screen to compute geometry --- lib/awful/layout/init.lua | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/lib/awful/layout/init.lua b/lib/awful/layout/init.lua index fb65b09d..984fdde9 100644 --- a/lib/awful/layout/init.lua +++ b/lib/awful/layout/init.lua @@ -136,27 +136,18 @@ function layout.parameters(t, screen) local p = {} - p.workarea = screen.workarea - local useless_gap = t and tag.getgap(t, #client.tiled(screen)) or 0 - -- Handle padding - local padding = ascreen.padding(screen) or {} - - p.workarea.x = p.workarea.x + (padding.left or 0) + useless_gap - - p.workarea.y = p.workarea.y + (padding.top or 0) + useless_gap - - p.workarea.width = p.workarea.width - ((padding.left or 0 ) + - (padding.right or 0) + useless_gap * 2) - - p.workarea.height = p.workarea.height - ((padding.top or 0) + - (padding.bottom or 0) + useless_gap * 2) + p.workarea = ascreen.get_bounding_geometry(screen, { + honor_padding = true, + honor_workarea = true, + margins = useless_gap, + }) p.geometry = screen.geometry p.clients = client.tiled(screen) p.screen = screen.index - p.padding = padding + p.padding = ascreen.padding(screen) p.useless_gap = useless_gap return p