diff --git a/resources/text/CHANGELOG b/resources/text/CHANGELOG
index bcdb6f259..da2ec00d0 100644
--- a/resources/text/CHANGELOG
+++ b/resources/text/CHANGELOG
@@ -19,6 +19,7 @@
Added:
- Key used for proxy/feed password coding is now stored in separate file. This file lies in the same directory as configuration file. If your use password-protected proxy/feeds, then make sure that NOBODY gets access to that file and your DB file in the same time.
+ - Notifications on Linux now supports D-Bus "org.freedesktop.Notifications" service. User must have enabled "modern & fancy notifications" for this to work. If D-Bus service is not available, then feature falls back to RSS Guard custom popup notifications.
Fixed:
diff --git a/src/gui/dialogs/formsettings.ui b/src/gui/dialogs/formsettings.ui
index 89f5be746..c55ccd4d6 100755
--- a/src/gui/dialogs/formsettings.ui
+++ b/src/gui/dialogs/formsettings.ui
@@ -88,7 +88,7 @@
-
- 1
+ 3
@@ -638,7 +638,7 @@ Authors of this application are NOT responsible for lost data.
-
- Fancy && modern popup notifications
+ Fancy && modern popup notifications (This uses OS native notifications via D-Bus if available.)
true
@@ -1289,7 +1289,7 @@ Authors of this application are NOT responsible for lost data.
-
- 1
+ 0
diff --git a/src/gui/notifications/notification.cpp b/src/gui/notifications/notification.cpp
index f855d42d3..efb7d4c18 100644
--- a/src/gui/notifications/notification.cpp
+++ b/src/gui/notifications/notification.cpp
@@ -82,6 +82,8 @@ void Notification::notify(const QString &text, const QString &title, const QIcon
m_icon = icon.pixmap(NOTIFICATION_ICON_SIZE, NOTIFICATION_ICON_SIZE);
#if defined(Q_OS_LINUX)
+ // On Linux, we try to send notification to session notification D-Bus service
+ // if it exists.
if (m_dBusInterface->isValid()) {
QVariantMap hints;
hints["image-path"] = ""; // "application-exit";
@@ -104,8 +106,10 @@ void Notification::notify(const QString &text, const QString &title, const QIcon
// Message was sent, notification should display.
m_dBusActiveNotification = response.arguments().at(0).toUInt();
}
+
+ return;
}
-#else
+
if (m_clickTarget != NULL && m_clickSlot != NULL) {
// Connect invokation target.
connect(this, SIGNAL(clicked()), m_clickTarget, m_clickSlot, Qt::QueuedConnection);
@@ -118,7 +122,6 @@ void Notification::notify(const QString &text, const QString &title, const QIcon
QTimer::singleShot(0, this, SLOT(repaint()));
m_timerId = startTimer(10000);
-#endif
}
void Notification::notify(const QString &text, const QString &title, QSystemTrayIcon::MessageIcon icon,
@@ -142,11 +145,13 @@ void Notification::cancel() {
}
}
+#if defined(Q_OS_LINUX)
void Notification::notificationClosed(uint id, uint reason) {
if (m_clickTarget != NULL && m_clickSlot != NULL && m_dBusActiveNotification == id && reason == 2) {
QMetaObject::invokeMethod(m_clickTarget, m_clickSlot);
}
}
+#endif
void Notification::updateGeometries() {
// Calculate width and height of notification with given icon and text.