X-Git-Url: https://git.madduck.net/etc/awesome.git/blobdiff_plain/430e70670c3f0a38c1c300273784096aeb8728cd..52b132d65ab6fbef617261f1445afacee9955c0e:/layout/cascade.lua?ds=inline diff --git a/layout/cascade.lua b/layout/cascade.lua index 2397a1d..2b02c00 100644 --- a/layout/cascade.lua +++ b/layout/cascade.lua @@ -8,14 +8,14 @@ --]] -local tag = require("awful.tag") +local scr = require("awful.screen") local tonumber = tonumber local cascade = { name = "cascade", nmaster = 0, offset_x = 32, - offset_y = 8, + offset_y = 8, tile = { name = "cascadetile", nmaster = 0, @@ -31,11 +31,14 @@ local function do_cascade(p, tiling) -- 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 if not tiling then -- Cascade windows. @@ -44,7 +47,7 @@ local function do_cascade(p, tiling) if cascade.nmaster > 0 then num_c = cascade.nmaster else - num_c = tag.master_count + num_c = ta.master_count end -- Opening a new window will usually force all existing windows to @@ -89,7 +92,7 @@ local function do_cascade(p, tiling) if cascade.tile.mwfact > 0 then mwfact = cascade.tile.mwfact else - mwfact = tag.getmwfact(t) + mwfact = ta.master_width_factor end -- Make slave windows overlap main window? Do this if ncol is 1. @@ -97,7 +100,7 @@ local function do_cascade(p, tiling) if cascade.tile.ncol > 0 then overlap_main = cascade.tile.ncol else - overlap_main = tag.column_count + overlap_main = ta.column_count end -- Minimum space for slave windows? See cascade.tile.lua. @@ -105,7 +108,7 @@ local function do_cascade(p, tiling) if cascade.tile.nmaster > 0 then num_c = cascade.tile.nmaster else - num_c = tag.master_count + num_c = ta.master_count end local how_many = (#cls - 1 >= num_c and (#cls - 1)) or num_c