naughty: Delete a screen's notification on removal

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2016-05-05 16:46:40 +02:00
parent 5b1f8cd35c
commit 5b9509d612
1 changed files with 10 additions and 0 deletions

View File

@ -154,6 +154,16 @@ screen.connect_for_each_screen(function(s)
}
end)
capi.screen.connect_signal("removed", function(scr)
-- Destroy all notifications on this screen
for _, list in pairs(naughty.notifications[scr]) do
while #list > 0 do
naughty.destroy(list[1])
end
end
naughty.notifications[scr] = nil
end)
--- Notification state
function naughty.is_suspended()
return suspended