From c3cdac368de787866d2ca1ec856a102014e2b4de Mon Sep 17 00:00:00 2001 From: Emmanuel Lepage Vallee Date: Sun, 15 Mar 2020 04:10:08 -0400 Subject: [PATCH] naughty: Stop request::icon as soon as there is an icon. --- lib/naughty/core.lua | 4 +++- lib/naughty/notification.lua | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/naughty/core.lua b/lib/naughty/core.lua index 9c24c034..4a4bab7a 100644 --- a/lib/naughty/core.lua +++ b/lib/naughty/core.lua @@ -274,7 +274,9 @@ function naughty.suspend() properties.suspended = true end -local conns = gobject._setup_class_signals(naughty) +local conns = gobject._setup_class_signals( + naughty, {allow_chain_of_responsibility=true} +) local function resume() properties.suspended = false diff --git a/lib/naughty/notification.lua b/lib/naughty/notification.lua index 5243553b..49fa26ed 100644 --- a/lib/naughty/notification.lua +++ b/lib/naughty/notification.lua @@ -647,6 +647,11 @@ for _, prop in ipairs { "category", "resident" } do end end +-- Stop the request::icon when one is found. +local function request_filter(self, _, _) + if self._private.icon then return true end +end + function notification.get_icon(self) -- Honor all overrides. if self._private.icon then @@ -689,7 +694,7 @@ function notification.get_icon(self) -- understand. if err then local ctx = self._private.app_icon and "app_icon" or "image" - naughty.emit_signal("request::icon", self, ctx, { + naughty._emit_signal_if("request::icon", request_filter, self, ctx, { app_icon = self._private.app_icon, image = self.image })