awful.layout: do not pass specific param in arrange (FS#541)

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-08-07 15:50:45 +02:00
parent 8a0f2aca28
commit 5a70fb6395
3 changed files with 8 additions and 11 deletions

View File

@ -65,7 +65,6 @@ end
-- Register an arrange hook. -- Register an arrange hook.
local function on_arrange (screen) local function on_arrange (screen)
local t = tag.selected(screen)
local p = {} local p = {}
p.workarea = wibox.get_workarea(screen) p.workarea = wibox.get_workarea(screen)
-- Handle padding -- Handle padding
@ -78,10 +77,6 @@ local function on_arrange (screen)
end end
p.geometry = capi.screen[screen].geometry p.geometry = capi.screen[screen].geometry
p.clients = client.tiled(screen) p.clients = client.tiled(screen)
p.ncol = tag.getncol(t)
p.nmaster = tag.getnmaster(t)
p.mwfact = tag.getmwfact(t)
p.tagdata = tag.getdata(t)
p.screen = screen p.screen = screen
get(screen).arrange(p) get(screen).arrange(p)
end end

View File

@ -23,7 +23,7 @@ function arrange(p)
local area = p.workarea local area = p.workarea
local cls = p.clients local cls = p.clients
local focus = capi.client.focus local focus = capi.client.focus
local mwfact = p.mwfact local mwfact = tag.getmwfact(tag.selected(p.screen))
local fidx local fidx
-- Check that the focused window is on the right screen -- Check that the focused window is on the right screen

View File

@ -9,6 +9,7 @@
-- Grab environment we need -- Grab environment we need
local ipairs = ipairs local ipairs = ipairs
local math = math local math = math
local tag = require("awful.tag")
--- Tiled layouts module for awful --- Tiled layouts module for awful
module("awful.layout.suit.tile") module("awful.layout.suit.tile")
@ -72,6 +73,7 @@ local function tile_group(cls, wa, orientation, fact, group)
end end
local function tile(param, orientation) local function tile(param, orientation)
local t = tag.selected(param.screen)
orientation = orientation or "right" orientation = orientation or "right"
-- this handles are different orientations -- this handles are different orientations
@ -87,18 +89,18 @@ local function tile(param, orientation)
end end
local cls = param.clients local cls = param.clients
local nmaster = math.min(param.nmaster, #cls) local nmaster = math.min(tag.getnmaster(t), #cls)
local nother = math.max(#cls - nmaster,0) local nother = math.max(#cls - nmaster,0)
local mwfact = param.mwfact local mwfact = tag.getmwfact(t)
local wa = param.workarea local wa = param.workarea
local ncol = param.ncol local ncol = tag.getncol(t)
local data = param.tagdata.windowfact local data = tag.getdata(t).windowfact
if not data then if not data then
data = {} data = {}
param.tagdata.windowfact = data tag.getdata(t).windowfact = data
end end
local coord = wa[x] local coord = wa[x]