diff --git a/lib/awful/autofocus.lua b/lib/awful/autofocus.lua index f1117f15c..878896c9f 100644 --- a/lib/awful/autofocus.lua +++ b/lib/awful/autofocus.lua @@ -18,6 +18,7 @@ local timer = require("gears.timer") -- -- @param obj An object that should have a .screen property. local function check_focus(obj) + if not obj.screen.valid then return end -- When no visible client has the focus... if not client.focus or not client.focus:isvisible() then local c = aclient.focus.history.get(screen[obj.screen], 0, aclient.focus.filter) @@ -39,7 +40,7 @@ end -- @param tag A tag object local function check_focus_tag(t) local s = t.screen - if not s then return end + if (not s) or (not s.valid) then return end s = screen[s] check_focus({ screen = s }) if client.focus and screen[client.focus.screen] ~= s then