From b0038c8ddba4e4da50de8cb40838c1bf3b743611 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Sun, 1 May 2016 19:44:17 +0200 Subject: [PATCH] awful.autofocus: Skip invalid screens This code uses delayed calls to lazily update things. Thanks to this, it can try to update a screen long after it was removed. Fix this by just doing nothing on invalid screens. Signed-off-by: Uli Schlachter --- lib/awful/autofocus.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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