ewmh.activate: set focus during startup

This is required for `awful.client.focus.history` to be properly filled
during restart/startup: a client might not be visible, but the focus
history needs to match the stacking order.
This commit is contained in:
Daniel Hahler 2015-10-13 12:00:33 +02:00
parent 208db47b2d
commit fcccc77d95
1 changed files with 5 additions and 2 deletions

View File

@ -153,14 +153,17 @@ local function geometry_change(window)
geometry_change_lock = false
end
--- Activate a window
--- Activate a window.
--
-- This sets the focus during startup (which adds it to
-- `awful.client.focus.history`), and if the client is visible.
--
-- @client c A client to use
-- @tparam string context The context where this signal was used.
-- @tparam[opt] table hints A table with additional hints:
-- @tparam[opt=false] boolean hints.raise should the client be raised?
function ewmh.activate(c, context, hints)
if c:isvisible() then
if awesome.startup or c:isvisible() then
client.focus = c
end
if hints and hints.raise then