[PATCH] libnotificationmanager: fix critical notifications not showing when Do not...
authorFushan Wen <qydwhotmail@gmail.com>
Fri, 16 May 2025 02:03:13 +0000 (10:03 +0800)
committerAurélien COUDERC <coucouf@debian.org>
Tue, 20 May 2025 06:31:26 +0000 (08:31 +0200)
The filter only checks if `WasAddedDuringInhibitionRole` is true but
ignores the urgency flag, which is used to show critical notifications
when Do not disturb is active.

(cherry picked from commit 49214ae107a4a13338876488b2bc28cf018d02c4)

Co-authored-by: Fushan Wen <qydwhotmail@gmail.com>
(cherry picked from commit 8642df804d1e59db9233c44943483348328b4982)

Co-authored-by: Fushan Wen <qydwhotmail@gmail.com>
Gbp-Pq: Name upstream_7635c551_libnotificationmanager-fix-critical-notifications-not-showing-when-Do-not-disturb-is-active.patch

libnotificationmanager/notificationfilterproxymodel.cpp

index 6e847a5eea5627531561fc24ecf393a9a1035f4c..f8ad1d93a83ceb333aebbec71f52f0b89a0923e3 100644 (file)
@@ -191,8 +191,12 @@ bool NotificationFilterProxyModel::filterAcceptsRow(int source_row, const QModel
         }
     }
 
-    if (!m_showAddedDuringInhibition && sourceIdx.data(Notifications::WasAddedDuringInhibitionRole).toBool()) {
-        return false;
+    // Normal Do Not Disturb filtering
+    if (!m_showAddedDuringInhibition) {
+        // Show critical notifications even in Do Not Disturb
+        if (!m_urgencies.testFlag(urgency) && sourceIdx.data(Notifications::WasAddedDuringInhibitionRole).toBool()) {
+            return false;
+        }
     }
 
     return true;