diff --git a/shell/browser/notifications/linux/libnotify_notification.cc b/shell/browser/notifications/linux/libnotify_notification.cc index e039b382e3..4c8452fad1 100644 --- a/shell/browser/notifications/linux/libnotify_notification.cc +++ b/shell/browser/notifications/linux/libnotify_notification.cc @@ -159,21 +159,21 @@ void LibnotifyNotification::Show(const NotificationOptions& options) { void LibnotifyNotification::Dismiss() { if (!notification_) { - Destroy(); return; } GError* error = nullptr; + on_dismissing_ = true; libnotify_loader_.notify_notification_close(notification_, &error); if (error) { log_and_clear_error(error, "notify_notification_close"); - Destroy(); } + on_dismissing_ = false; } void LibnotifyNotification::OnNotificationClosed( NotifyNotification* notification) { - NotificationDismissed(); + NotificationDismissed(!on_dismissing_); } void LibnotifyNotification::OnNotificationView(NotifyNotification* notification, diff --git a/shell/browser/notifications/linux/libnotify_notification.h b/shell/browser/notifications/linux/libnotify_notification.h index 8aacd09520..315419fc5c 100644 --- a/shell/browser/notifications/linux/libnotify_notification.h +++ b/shell/browser/notifications/linux/libnotify_notification.h @@ -33,6 +33,7 @@ class LibnotifyNotification : public Notification { RAW_PTR_EXCLUSION NotifyNotification* notification_ = nullptr; ScopedGSignal signal_; + bool on_dismissing_ = false; }; } // namespace electron