Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: don't do self-destroy in LibnotifyNotification::Dismiss() #41708

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions shell/browser/notifications/linux/libnotify_notification.cc
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions shell/browser/notifications/linux/libnotify_notification.h
Expand Up @@ -33,6 +33,7 @@ class LibnotifyNotification : public Notification {
RAW_PTR_EXCLUSION NotifyNotification* notification_ = nullptr;

ScopedGSignal signal_;
bool on_dismissing_ = false;
};

} // namespace electron
Expand Down