mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +02:00
Do not call CloseNotification for activatable services
If the notification daemon is an activatable GApplication service (e.g. on Mate), then the notification daemon may terminate a short time after the notification has vanished (usually 15s). In that case the notification daemon may reuse notification IDs, which is incompatible with our notification clearing. Also the service may not be running at all, when we call the CloseNotification endpoint. To fix this, we simply disable the entire notification history clearing functionality on such desktops by proactively clearing all notification references from our internal notification manager. Signed-off-by: Magnus Groß <magnus.gross@rwth-aachen.de>
This commit is contained in:
parent
4dd14b81e1
commit
b39e4a3138
1 changed files with 6 additions and 1 deletions
|
@ -74,6 +74,9 @@ std::unique_ptr<base::Platform::DBus::ServiceWatcher> CreateServiceWatcher() {
|
|||
const Glib::ustring &oldOwner,
|
||||
const Glib::ustring &newOwner) {
|
||||
if (activatable && newOwner.empty()) {
|
||||
crl::on_main([] {
|
||||
Core::App().notifications().clearAll();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -665,7 +668,9 @@ void NotificationData::close() {
|
|||
_notificationId,
|
||||
}),
|
||||
{},
|
||||
std::string(kService));
|
||||
std::string(kService),
|
||||
-1,
|
||||
Gio::DBus::CALL_FLAGS_NO_AUTO_START);
|
||||
_manager->clearNotification(_id);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue