awful.client: deprecate swap()
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
71b93f44dd
commit
e0730d0da8
|
@ -13,6 +13,7 @@ local ipairs = ipairs
|
||||||
local table = table
|
local table = table
|
||||||
local math = math
|
local math = math
|
||||||
local otable = otable
|
local otable = otable
|
||||||
|
local setmetatable = setmetatable
|
||||||
local capi =
|
local capi =
|
||||||
{
|
{
|
||||||
client = client,
|
client = client,
|
||||||
|
@ -343,7 +344,7 @@ end
|
||||||
--- Swap a client by its relative index.
|
--- Swap a client by its relative index.
|
||||||
-- @param i The index.
|
-- @param i The index.
|
||||||
-- @param c Optional client, otherwise focused one is used.
|
-- @param c Optional client, otherwise focused one is used.
|
||||||
function swap(i, c)
|
function swap.byidx(i, c)
|
||||||
local sel = c or capi.client.focus
|
local sel = c or capi.client.focus
|
||||||
local target = next(i, sel)
|
local target = next(i, sel)
|
||||||
if target then
|
if target then
|
||||||
|
@ -351,6 +352,13 @@ function swap(i, c)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Compatibility
|
||||||
|
local function __swap(self, i, c)
|
||||||
|
util.deprecate()
|
||||||
|
swap.byidx(i, c)
|
||||||
|
end
|
||||||
|
setmetatable(swap, { __call = __swap })
|
||||||
|
|
||||||
--- Get the master window.
|
--- Get the master window.
|
||||||
-- @param screen Optional screen number, otherwise screen mouse is used.
|
-- @param screen Optional screen number, otherwise screen mouse is used.
|
||||||
-- @return The master window.
|
-- @return The master window.
|
||||||
|
|
Loading…
Reference in New Issue