Skip to content

Commit

Permalink
fix: remove lingering data when notifications autodismiss on Windows 7 (
Browse files Browse the repository at this point in the history
  • Loading branch information
trop[bot] authored and zcbenz committed Jun 12, 2019
1 parent 99c3ff6 commit eaa22b4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
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

0 comments on commit eaa22b4

Please sign in to comment.