diff --git a/src/notifications/Manager.h b/src/notifications/Manager.h index 7686d78e91f7ba8ef0648e17d6d646ab1810ed92..fbebfcbacd8c55da4408c3862b1bf083e1adaff4 100644 --- a/src/notifications/Manager.h +++ b/src/notifications/Manager.h @@ -101,6 +101,7 @@ private: // but Qt slot declarations can not be inside an ifdef! private slots: void actionInvoked(uint id, QString action); + void activationToken(uint id, QString action); void notificationClosed(uint id, uint reason); void notificationReplied(uint id, QString reply); diff --git a/src/notifications/ManagerLinux.cpp b/src/notifications/ManagerLinux.cpp index e838bb85bb6470ad386a24e4c4d994fea3d752e4..b181fdc395bd53f9be6486b5f83867a06f261911 100644 --- a/src/notifications/ManagerLinux.cpp +++ b/src/notifications/ManagerLinux.cpp @@ -22,6 +22,7 @@ #include "Cache.h" #include "EventAccessors.h" +#include "Logging.h" #include "MxcImageProvider.h" #include "UserSettingsPage.h" #include "Utils.h" @@ -58,6 +59,12 @@ NotificationsManager::NotificationsManager(QObject *parent) QStringLiteral("ActionInvoked"), this, SLOT(actionInvoked(uint,QString))); + QDBusConnection::sessionBus().connect(QStringLiteral("org.freedesktop.Notifications"), + QStringLiteral("/org/freedesktop/Notifications"), + QStringLiteral("org.freedesktop.Notifications"), + QStringLiteral("ActivationToken"), + this, + SLOT(activationToken(uint,QString))); QDBusConnection::sessionBus().connect(QStringLiteral("org.freedesktop.Notifications"), QStringLiteral("/org/freedesktop/Notifications"), QStringLiteral("org.freedesktop.Notifications"), @@ -256,6 +263,14 @@ NotificationsManager::actionInvoked(uint id, QString action) } } +// receive a wayland activation token from the notification manager +void +NotificationsManager::activationToken(uint, QString action) +{ + nhlog::net()->debug("Got activation token for notification"); + qputenv("XDG_ACTIVATION_TOKEN", action.toUtf8()); +} + void NotificationsManager::notificationReplied(uint id, QString reply) { diff --git a/src/notifications/ManagerMac.mm b/src/notifications/ManagerMac.mm index 69914ac63b2536fb757e19689f20e4a6730428f5..06e6e55e2f65320e3027a9110cccb783651a2e96 100644 --- a/src/notifications/ManagerMac.mm +++ b/src/notifications/ManagerMac.mm @@ -182,6 +182,8 @@ void NotificationsManager::attachToMacNotifCenter() // unused void NotificationsManager::actionInvoked(uint, QString) { } +void NotificationsManager::activationToken(uint, QString) { } + void NotificationsManager::notificationReplied(uint, QString) { } void NotificationsManager::notificationClosed(uint, uint) { } diff --git a/src/notifications/ManagerWin.cpp b/src/notifications/ManagerWin.cpp index ce0143b0a0a33e6e976e6b4f840705f48987a05d..8d200abcf93ffaebd77800a6dcbd0928bc47327e 100644 --- a/src/notifications/ManagerWin.cpp +++ b/src/notifications/ManagerWin.cpp @@ -95,6 +95,10 @@ void NotificationsManager::actionInvoked(uint, QString) {} +void +NotificationsManager::activationToken(uint, QString) +{} + void NotificationsManager::notificationReplied(uint, QString) {}