Merge pull request #527 from blueyed/client-focus-history-get-stacked
client.focus.history.get: use stacked client list
This commit is contained in:
commit
017660de48
|
@ -181,7 +181,7 @@ end
|
||||||
function client.focus.history.get(screen, idx, filter)
|
function client.focus.history.get(screen, idx, filter)
|
||||||
-- When this counter is equal to idx, we return the client
|
-- When this counter is equal to idx, we return the client
|
||||||
local counter = 0
|
local counter = 0
|
||||||
local vc = client.visible(screen)
|
local vc = client.visible(screen, true)
|
||||||
for k, c in ipairs(client.data.focus) do
|
for k, c in ipairs(client.data.focus) do
|
||||||
if c.screen == screen then
|
if c.screen == screen then
|
||||||
if not filter or filter(c) then
|
if not filter or filter(c) then
|
||||||
|
@ -224,7 +224,7 @@ end
|
||||||
--- Get visible clients from a screen.
|
--- Get visible clients from a screen.
|
||||||
--
|
--
|
||||||
-- @tparam[opt] integer screen The screen number, or nil for all screens.
|
-- @tparam[opt] integer screen The screen number, or nil for all screens.
|
||||||
-- @tparam[opt=false] boolean stacked Use stacking order?
|
-- @tparam[opt=false] boolean stacked Use stacking order? (top to bottom)
|
||||||
-- @treturn table A table with all visible clients.
|
-- @treturn table A table with all visible clients.
|
||||||
function client.visible(screen, stacked)
|
function client.visible(screen, stacked)
|
||||||
local cls = capi.client.get(screen, stacked)
|
local cls = capi.client.get(screen, stacked)
|
||||||
|
@ -240,7 +240,7 @@ end
|
||||||
--- Get visible and tiled clients
|
--- Get visible and tiled clients
|
||||||
--
|
--
|
||||||
-- @tparam integer screen The screen number, or nil for all screens.
|
-- @tparam integer screen The screen number, or nil for all screens.
|
||||||
-- @tparam[opt=false] boolean stacked Use stacking order?
|
-- @tparam[opt=false] boolean stacked Use stacking order? (top to bottom)
|
||||||
-- @treturn table A table with all visible and tiled clients.
|
-- @treturn table A table with all visible and tiled clients.
|
||||||
function client.tiled(screen, stacked)
|
function client.tiled(screen, stacked)
|
||||||
local clients = client.visible(screen, stacked)
|
local clients = client.visible(screen, stacked)
|
||||||
|
@ -262,7 +262,7 @@ end
|
||||||
--
|
--
|
||||||
-- @tparam int i The index. Use 1 to get the next, -1 to get the previous.
|
-- @tparam int i The index. Use 1 to get the next, -1 to get the previous.
|
||||||
-- @client[opt] c The client.
|
-- @client[opt] c The client.
|
||||||
-- @tparam[opt=false] boolean stacked Use stacking order?
|
-- @tparam[opt=false] boolean stacked Use stacking order? (top to bottom)
|
||||||
-- @return A client, or nil if no client is available.
|
-- @return A client, or nil if no client is available.
|
||||||
--
|
--
|
||||||
-- @usage -- focus the next window in the index
|
-- @usage -- focus the next window in the index
|
||||||
|
@ -298,7 +298,7 @@ end
|
||||||
-- @tparam string dir The direction, can be either
|
-- @tparam string dir The direction, can be either
|
||||||
-- `"up"`, `"down"`, `"left"` or `"right"`.
|
-- `"up"`, `"down"`, `"left"` or `"right"`.
|
||||||
-- @client[opt] c The client.
|
-- @client[opt] c The client.
|
||||||
-- @tparam[opt=false] boolean stacked Use stacking order?
|
-- @tparam[opt=false] boolean stacked Use stacking order? (top to bottom)
|
||||||
function client.focus.bydirection(dir, c, stacked)
|
function client.focus.bydirection(dir, c, stacked)
|
||||||
local sel = c or capi.client.focus
|
local sel = c or capi.client.focus
|
||||||
if sel then
|
if sel then
|
||||||
|
@ -322,7 +322,7 @@ end
|
||||||
--
|
--
|
||||||
-- @param dir The direction, can be either "up", "down", "left" or "right".
|
-- @param dir The direction, can be either "up", "down", "left" or "right".
|
||||||
-- @client[opt] c The client.
|
-- @client[opt] c The client.
|
||||||
-- @tparam[opt=false] boolean stacked Use stacking order?
|
-- @tparam[opt=false] boolean stacked Use stacking order? (top to bottom)
|
||||||
function client.focus.global_bydirection(dir, c, stacked)
|
function client.focus.global_bydirection(dir, c, stacked)
|
||||||
local sel = c or capi.client.focus
|
local sel = c or capi.client.focus
|
||||||
local scr = sel and sel.screen or screen.focused()
|
local scr = sel and sel.screen or screen.focused()
|
||||||
|
@ -365,7 +365,7 @@ end
|
||||||
--- Swap a client with another client in the given direction.
|
--- Swap a client with another client in the given direction.
|
||||||
-- @tparam string dir The direction, can be either "up", "down", "left" or "right".
|
-- @tparam string dir The direction, can be either "up", "down", "left" or "right".
|
||||||
-- @client[opt=focused] c The client.
|
-- @client[opt=focused] c The client.
|
||||||
-- @tparam[opt=false] boolean stacked Use stacking order?
|
-- @tparam[opt=false] boolean stacked Use stacking order? (top to bottom)
|
||||||
function client.swap.bydirection(dir, c, stacked)
|
function client.swap.bydirection(dir, c, stacked)
|
||||||
local sel = c or capi.client.focus
|
local sel = c or capi.client.focus
|
||||||
if sel then
|
if sel then
|
||||||
|
@ -430,7 +430,7 @@ end
|
||||||
--
|
--
|
||||||
-- @param clockwise True to cycle clients clockwise.
|
-- @param clockwise True to cycle clients clockwise.
|
||||||
-- @param[opt] s The screen where to cycle clients.
|
-- @param[opt] s The screen where to cycle clients.
|
||||||
-- @tparam[opt=false] boolean stacked Use stacking order?
|
-- @tparam[opt=false] boolean stacked Use stacking order? (top to bottom)
|
||||||
function client.cycle(clockwise, s, stacked)
|
function client.cycle(clockwise, s, stacked)
|
||||||
s = s or screen.focused()
|
s = s or screen.focused()
|
||||||
local cls = client.visible(s, stacked)
|
local cls = client.visible(s, stacked)
|
||||||
|
|
Loading…
Reference in New Issue