fix invalid object errors (steam)

This commit is contained in:
BZ 2020-06-19 12:04:43 +02:00
parent 9083b39327
commit 51fbad9e27
1 changed files with 7 additions and 3 deletions

View File

@ -66,7 +66,9 @@ local function setup(config)
client.connect_signal("manage", function(c)
-- set icon based on c.class
awful.spawn.easy_async_with_shell("sleep " .. delay, function()
if c and c.valid and icons[c.class] then
set_icon(c, icons[c.class])
end
end)
if len(dynamic_icons) == 0 then
@ -94,8 +96,10 @@ return setmetatable(module, { __call = function(_, ...)
-- we also have to manually emit a fake "property::name" signal to update dynamic icons.
awful.spawn.easy_async_with_shell("sleep " .. delay, function()
for _, c in ipairs(client.get()) do
if c and c.valid and icons[c.class] then
set_icon(c, icons[c.class])
c:emit_signal("property::name")
end
end
end)
end })