2008-11-25 17:01:06 +01:00
|
|
|
---------------------------------------------------------------------------
|
|
|
|
-- @author Julien Danjou <julien@danjou.info>
|
|
|
|
-- @copyright 2008 Julien Danjou
|
|
|
|
-- @release @AWESOME_VERSION@
|
|
|
|
---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
-- Grab environment we need
|
|
|
|
local setmetatable = setmetatable
|
|
|
|
local pairs = pairs
|
|
|
|
local client = require("awful.client")
|
|
|
|
local capi =
|
|
|
|
{
|
|
|
|
screen = screen
|
|
|
|
}
|
|
|
|
|
|
|
|
--- Maximized and fullscreen layouts module for awful
|
|
|
|
module("awful.layout.suit.max")
|
|
|
|
|
|
|
|
local function fmax(screen, fs)
|
|
|
|
-- Fullscreen?
|
|
|
|
local area
|
|
|
|
if fs then
|
|
|
|
area = capi.screen[screen].geometry
|
|
|
|
else
|
|
|
|
area = capi.screen[screen].workarea
|
|
|
|
end
|
|
|
|
|
|
|
|
for k, c in pairs(client.visible(screen)) do
|
2008-12-01 16:26:41 +01:00
|
|
|
if not client.floating.get(c) then
|
2008-12-12 00:01:43 +01:00
|
|
|
c:geometry(area)
|
2008-11-25 17:01:06 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
--- Maximized layout.
|
|
|
|
-- @param screen The screen to arrange.
|
|
|
|
local function max(_, screen)
|
|
|
|
return fmax(screen, false)
|
|
|
|
end
|
|
|
|
|
|
|
|
--- Fullscreen layout.
|
|
|
|
-- @param screen The screen to arrange.
|
|
|
|
function fullscreen(screen)
|
|
|
|
return fmax(screen, true)
|
|
|
|
end
|
|
|
|
|
|
|
|
setmetatable(_M, { __call = max })
|