Make awful.layout.inc() accept a screen number

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Poggles 2013-02-19 03:53:58 +00:00 committed by Uli Schlachter
parent f859131bf3
commit bd05219a72
1 changed files with 5 additions and 4 deletions

View File

@ -37,10 +37,11 @@ end
--- Change the layout of the current tag.
-- @param layouts A table of layouts.
-- @param i Relative index.
function layout.inc(layouts, i)
local t = tag.selected()
-- @param s The screen number.
function layout.inc(layouts, i, s)
local t = tag.selected(s)
if t then
local curlayout = layout.get()
local curlayout = layout.get(s)
local curindex
local rev_layouts = {}
for k, v in ipairs(layouts) do
@ -51,7 +52,7 @@ function layout.inc(layouts, i)
end
if curindex then
local newindex = util.cycle(#layouts, curindex + i)
layout.set(layouts[newindex])
layout.set(layouts[newindex], t)
end
end
end