From cbbef4ff578071e79c2359d9eefa2eb141a09e38 Mon Sep 17 00:00:00 2001 From: Emanoil Kotsev Date: Sun, 30 Nov 2025 22:42:29 +0000 Subject: Add support for resident notifications hint Signed-off-by: Emanoil Kotsev --- src/daemon/NotificationsService.cpp | 7 +++++++ src/daemon/NotifyWidget.cpp | 8 ++++++++ src/daemon/NotifyWidget.h | 3 +++ 3 files changed, 18 insertions(+) (limited to 'src') diff --git a/src/daemon/NotificationsService.cpp b/src/daemon/NotificationsService.cpp index e91b0ed..07cd3bf 100644 --- a/src/daemon/NotificationsService.cpp +++ b/src/daemon/NotificationsService.cpp @@ -165,6 +165,11 @@ void NotificationsService::NotifyAsync( mNotificationMap[nId]->setSuppressSound(it.data().value.toBool(&ok)); if(!ok) errStr += " suppress-sound"; } + else if (it.key()=="resident") + { + mNotificationMap[nId]->setResident(it.data().value.toBool(&ok)); + if(!ok) errStr += " resident"; + } else if (it.key()=="transient") { mNotificationMap[nId]->setTransient(it.data().value.toBool(&ok)); @@ -191,6 +196,8 @@ void NotificationsService::NotifyAsync( mNotificationMap[nId]->setActions(actions); if(mNotificationMap[nId]->isTransient() && timeout == 0) timeout = -1; // use server defined timeout (transient bypasses persistence on the server) + if(mNotificationMap[nId]->isResident() && timeout != 0) + timeout = 0; // resident takes advantage of persistence) mNotificationMap[nId]->setTimeout(timeout); mNotificationMap[nId]->adjustSize(); mNotificationMap[nId]->raise(); diff --git a/src/daemon/NotifyWidget.cpp b/src/daemon/NotifyWidget.cpp index f80036d..d780957 100644 --- a/src/daemon/NotifyWidget.cpp +++ b/src/daemon/NotifyWidget.cpp @@ -189,6 +189,14 @@ void NotifyWidget::setSuppressSound(bool s) { mSuppressSound = s; } +void NotifyWidget::setResident(bool r) { + mResident = r; +} + +bool NotifyWidget::isResident() { + return mResident; +} + void NotifyWidget::setTransient(bool t) { mTransient = t; } diff --git a/src/daemon/NotifyWidget.h b/src/daemon/NotifyWidget.h index 4191f1c..d80c154 100644 --- a/src/daemon/NotifyWidget.h +++ b/src/daemon/NotifyWidget.h @@ -87,6 +87,8 @@ Categories are in class.specific form. class specifies the generic type of notif void setSoundFile(const TQString&); void setSoundName(const TQString&); void setSuppressSound(bool); + void setResident(bool); + bool isResident(); void setTransient(bool); bool isTransient(); void setUrgency(TQ_UINT8); @@ -145,6 +147,7 @@ private: TQString mSoundName; bool mPersistence; bool mSuppressSound; + bool mResident; bool mTransient; TQ_INT64 mSenderPid; -- cgit v1.2.3