summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2023-05-05 10:47:20 +0200
committerAnton Khirnov <anton@khirnov.net>2023-05-05 10:47:20 +0200
commit4297b1b03f6bf301e8096bee6a433e5fb3c5c5be (patch)
tree2bd0693618a2d5ef41bec190af7376ff7068feec
parent3c62f2d59a7319aef2eedbe0d2c6cc8bb9f87f03 (diff)
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.
-rw-r--r--rc.lua3
1 files changed, 2 insertions, 1 deletions
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)