From 4297b1b03f6bf301e8096bee6a433e5fb3c5c5be Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Fri, 5 May 2023 10:47:20 +0200 Subject: rc: use pcall for delayed focusing new clients They might immediately disappear and be gone by the time the delayed call is executed - using pcall suppresses the exception. --- rc.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rc.lua b/rc.lua index 28eb8e8..53f4987 100644 --- a/rc.lua +++ b/rc.lua @@ -201,7 +201,8 @@ client.connect_signal("manage", function (c, startup) -- give the new client focus if c.focusable then - gears.timer.delayed_call(function(c) c:jump_to(false) end, c) + -- use pcall() because the client might be gone by the time we get to it + gears.timer.delayed_call(pcall, function() c:jump_to(false) end) end end) -- cgit v1.2.3