From 5b9509d612303bed5a8915c2eee02a838c40c019 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Thu, 5 May 2016 16:46:40 +0200 Subject: [PATCH] naughty: Delete a screen's notification on removal Signed-off-by: Uli Schlachter --- lib/naughty/core.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/naughty/core.lua b/lib/naughty/core.lua index 4f04f67f..be2f46ae 100644 --- a/lib/naughty/core.lua +++ b/lib/naughty/core.lua @@ -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