fix: Windows Toast notification dismissal from Action Center (#40197)

* fix: Windows Toast notification dismissal from Action Center

* docs: note Toast behavior in  event

* chore: address feedback from review
This commit is contained in:
Shelley Vohr 2023-10-18 01:33:00 +02:00 committed by GitHub
parent 73a42d0b7b
commit 666907d50d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 101 additions and 43 deletions

View file

@ -27,10 +27,14 @@ void Notification::NotificationClicked() {
Destroy();
}
void Notification::NotificationDismissed() {
void Notification::NotificationDismissed(bool should_destroy) {
if (delegate())
delegate()->NotificationClosed();
Destroy();
set_is_dismissed(true);
if (should_destroy)
Destroy();
}
void Notification::NotificationFailed(const std::string& error) {
@ -39,6 +43,8 @@ void Notification::NotificationFailed(const std::string& error) {
Destroy();
}
void Notification::Remove() {}
void Notification::Destroy() {
presenter()->RemoveNotification(this);
}