awful.screen: add stacked arg to some functions (#1301)
Fixes https://github.com/awesomeWM/awesome/issues/1300
This commit is contained in:
parent
397fb2eb7f
commit
d13f465374
|
@ -302,21 +302,32 @@ function screen.object.get_bounding_geometry(self, args)
|
||||||
return geo
|
return geo
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the list of visible clients for the screen.
|
--- The list of visible clients for the screen.
|
||||||
--
|
--
|
||||||
-- Minimized and unmanaged clients are not included in this list as they are
|
-- Minimized and unmanaged clients are not included in this list as they are
|
||||||
-- technically not on the screen.
|
-- technically not on the screen.
|
||||||
--
|
--
|
||||||
-- The clients on tags that are currently not visible are not part of this list.
|
-- The clients on tags that are currently not visible are not part of this list.
|
||||||
--
|
--
|
||||||
|
-- Clients are returned using the stacking order (from top to bottom).
|
||||||
|
-- See `get_clients` if you want them in the order used in the tasklist by
|
||||||
|
-- default.
|
||||||
|
--
|
||||||
-- @property clients
|
-- @property clients
|
||||||
-- @param table The clients list, ordered from top to bottom.
|
-- @param table The clients list, ordered from top to bottom.
|
||||||
-- @see all_clients
|
-- @see all_clients
|
||||||
-- @see hidden_clients
|
-- @see hidden_clients
|
||||||
-- @see client.get
|
-- @see client.get
|
||||||
|
|
||||||
function screen.object.get_clients(s)
|
--- Get the list of visible clients for the screen.
|
||||||
local cls = capi.client.get(s, true)
|
--
|
||||||
|
-- This is used by `screen.clients` internally (with `stacked=true`).
|
||||||
|
--
|
||||||
|
-- @function client:get_clients
|
||||||
|
-- @tparam[opt=true] boolean stacked Use stacking order? (top to bottom)
|
||||||
|
-- @treturn table The clients list.
|
||||||
|
function screen.object.get_clients(s, stacked)
|
||||||
|
local cls = capi.client.get(s, stacked == nil and true or stacked)
|
||||||
local vcls = {}
|
local vcls = {}
|
||||||
for _, c in pairs(cls) do
|
for _, c in pairs(cls) do
|
||||||
if c:isvisible() then
|
if c:isvisible() then
|
||||||
|
@ -347,7 +358,7 @@ function screen.object.get_hidden_clients(s)
|
||||||
return vcls
|
return vcls
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get all clients assigned to the screen.
|
--- All clients assigned to the screen.
|
||||||
--
|
--
|
||||||
-- @property all_clients
|
-- @property all_clients
|
||||||
-- @param table The clients list, ordered from top to bottom.
|
-- @param table The clients list, ordered from top to bottom.
|
||||||
|
@ -355,11 +366,18 @@ end
|
||||||
-- @see hidden_clients
|
-- @see hidden_clients
|
||||||
-- @see client.get
|
-- @see client.get
|
||||||
|
|
||||||
function screen.object.get_all_clients(s)
|
--- Get all clients assigned to the screen.
|
||||||
return capi.client.get(s, true)
|
--
|
||||||
|
-- This is used by `all_clients` internally (with `stacked=true`).
|
||||||
|
--
|
||||||
|
-- @function client:get_all_clients
|
||||||
|
-- @tparam[opt=true] boolean stacked Use stacking order? (top to bottom)
|
||||||
|
-- @treturn table The clients list.
|
||||||
|
function screen.object.get_all_clients(s, stacked)
|
||||||
|
return capi.client.get(s, stacked == nil and true or stacked)
|
||||||
end
|
end
|
||||||
|
|
||||||
--- Get the list of tiled clients for the screen.
|
--- Tiled clients for the screen.
|
||||||
--
|
--
|
||||||
-- Same as `clients`, but excluding:
|
-- Same as `clients`, but excluding:
|
||||||
--
|
--
|
||||||
|
@ -370,8 +388,15 @@ end
|
||||||
-- @property tiled_clients
|
-- @property tiled_clients
|
||||||
-- @param table The clients list, ordered from top to bottom.
|
-- @param table The clients list, ordered from top to bottom.
|
||||||
|
|
||||||
function screen.object.get_tiled_clients(s)
|
--- Get tiled clients for the screen.
|
||||||
local clients = s.clients
|
--
|
||||||
|
-- This is used by `tiles_clients` internally (with `stacked=true`).
|
||||||
|
--
|
||||||
|
-- @function client:get_tiled_clients
|
||||||
|
-- @tparam[opt=true] boolean stacked Use stacking order? (top to bottom)
|
||||||
|
-- @treturn table The clients list.
|
||||||
|
function screen.object.get_tiled_clients(s, stacked)
|
||||||
|
local clients = s:get_clients(stacked)
|
||||||
local tclients = {}
|
local tclients = {}
|
||||||
-- Remove floating clients
|
-- Remove floating clients
|
||||||
for _, c in pairs(clients) do
|
for _, c in pairs(clients) do
|
||||||
|
|
Loading…
Reference in New Issue