From fcccc77d95e0f764f886478ce482aaa2ba49602f Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Tue, 13 Oct 2015 12:00:33 +0200 Subject: [PATCH] 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. --- lib/awful/ewmh.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/awful/ewmh.lua b/lib/awful/ewmh.lua index 96832b254..37a0496b7 100644 --- a/lib/awful/ewmh.lua +++ b/lib/awful/ewmh.lua @@ -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