X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/430e70670c3f0a38c1c300273784096aeb8728cd..5318966270d86d52a2b9d7244b9336544a946d85:/layout/centerwork.lua diff --git a/layout/centerwork.lua b/layout/centerwork.lua index ce3d9e8..a8d9a96 100644 --- a/layout/centerwork.lua +++ b/layout/centerwork.lua @@ -10,9 +10,9 @@ --]] -local tag = require("awful.tag") -local tonumber = tonumber -local math = { floor = math.floor } +local tonumber = tonumber +local math = { floor = math.floor } +local scr = require("awful.screen") local centerwork = { name = "centerwork", @@ -23,17 +23,20 @@ local function do_centerwork(p, orientation) -- Screen. local wa = p.workarea local cls = p.clients + local ta = scr.focused().selected_tag + + if not ta then return end if #cls <= 0 then return end -- Useless gaps. - local useless_gap = tag.gap or 0 + local useless_gap = p.useless_gap or 0 local c = cls[1] local g = {} -- Main column, fixed width and height. - local mwfact = tag.object.get_master_width_factor(t) + local mwfact = ta.master_width_factor local mainhei = math.floor(wa.height * mwfact) local mainwid = math.floor(wa.width * mwfact) local slavewid = wa.width - mainwid