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: remove lingering data when notifications autodismiss on Windows 7 #18741

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
Expand Up @@ -269,10 +269,16 @@ LRESULT DesktopNotificationController::Toast::WndProc(HWND hwnd,
case WM_MOUSEACTIVATE:
return MA_NOACTIVATE;

case WM_TIMER:
case WM_TIMER: {
if (wparam == TimerID_AutoDismiss) {
Get(hwnd)->AutoDismiss();
auto* inst = Get(hwnd);

Notification notification(inst->data_);
inst->data_->controller->OnNotificationDismissed(notification);

inst->AutoDismiss();
}
}
return 0;

case WM_LBUTTONDOWN: {
Expand Down
4 changes: 4 additions & 0 deletions atom/browser/notifications/win/win32_notification.cc
Expand Up @@ -47,8 +47,12 @@ void Win32Notification::Show(const NotificationOptions& options) {

if (existing) {
existing->tag_.clear();

this->notification_ref_ = std::move(existing->notification_ref_);
this->notification_ref_.Set(options.title, options.msg, image);
// Need to remove the entry in the notifications set that
// NotificationPresenter is holding
existing->Destroy();
} else {
this->notification_ref_ =
presenter->AddNotification(options.title, options.msg, image);
Expand Down