Makes awful.client.restore return the restored client
If some client is restored, returns it, otherwise returns nil. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
c1addbbf72
commit
98185eb123
|
@ -666,7 +666,7 @@ end
|
||||||
|
|
||||||
--- Restore (=unminimize) a random client.
|
--- Restore (=unminimize) a random client.
|
||||||
-- @param s The screen to use.
|
-- @param s The screen to use.
|
||||||
-- @return True if some client was restored.
|
-- @return The restored client if some client was restored, otherwise nil.
|
||||||
function client.restore(s)
|
function client.restore(s)
|
||||||
local s = s or (capi.client.focus and capi.client.focus.screen) or capi.mouse.screen
|
local s = s or (capi.client.focus and capi.client.focus.screen) or capi.mouse.screen
|
||||||
local cls = capi.client.get(s)
|
local cls = capi.client.get(s)
|
||||||
|
@ -678,12 +678,12 @@ function client.restore(s)
|
||||||
for k, t in ipairs(tags) do
|
for k, t in ipairs(tags) do
|
||||||
if util.table.hasitem(ctags, t) then
|
if util.table.hasitem(ctags, t) then
|
||||||
c.minimized = false
|
c.minimized = false
|
||||||
return true
|
return c
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Normalize a set of numbers to 1
|
-- Normalize a set of numbers to 1
|
||||||
|
|
Loading…
Reference in New Issue