From 29cef2d6158a87f7e559becda725b77290e722c8 Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Thu, 3 Jan 2019 03:09:42 -0500 Subject: [PATCH] notification: Add a new destroyed reason for "lack of space". they were previously silently dismissed. --- lib/naughty/constants.lua | 1 + lib/naughty/notification.lua | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/naughty/constants.lua b/lib/naughty/constants.lua index aa7906bc..f7c883a7 100644 --- a/lib/naughty/constants.lua +++ b/lib/naughty/constants.lua @@ -59,6 +59,7 @@ ret.config.defaults = { } ret.notification_closed_reason = { + too_many_on_screen = -2, silent = -1, expired = 1, dismissedByUser = 2, --TODO v5 remove this undocumented legacy constant diff --git a/lib/naughty/notification.lua b/lib/naughty/notification.lua index fd76ff8a..f85cf621 100644 --- a/lib/naughty/notification.lua +++ b/lib/naughty/notification.lua @@ -218,6 +218,9 @@ local notification = {} --- Emitted when the notification is destroyed. -- @signal destroyed +-- @tparam number reason Why it was destroyed +-- @tparam boolean keep_visible If it was kept visible. +-- @see naughty.notification_closed_reason -- . --FIXME needs a description -- @property ignore_suspend If set to true this notification @@ -234,7 +237,7 @@ local notification = {} -- @tparam[opt=false] boolean keep_visible If true, keep the notification visible -- @return True if the popup was successfully destroyed, nil otherwise function notification:destroy(reason, keep_visible) - self:emit_signal("destroyed") + self:emit_signal("destroyed", reason, keep_visible) return true end