Issue for this PR
No linked issue. Follow-up to #65325, raised while reading its merged diff.
Type of change
What does this PR do?
Main keeps at most 40 Windows toasts it can take back. Past that, it dropped the oldest from its map without closing it, so that toast stayed in the notification center, and an answer to its request could no longer take it back.
Now the evicted toast is closed too (dismiss(oldest)), so every toast still in the notification center is one an answer takes back. Windows keeps far fewer toasts per app than 40 anyway, so in practice the evicted one has usually left already.
A toast the person dismisses by hand still stays in the map until it is replaced, answered or evicted. Windows reports a toast that timed out into the notification center the same way, and that one must stay so an answer can take it back. Closing an already-dismissed toast does nothing.
Windows only: the toasts in this map are posted only on Windows.
How did you verify your code works?
- Read against
show/dismiss: eviction now goes through dismiss, which closes and forgets the toast; the new toast is added after.
- CI runs the desktop type check and unit tests.
- Not tested: 41 toasts on a real Windows desktop.
Screenshots / recordings
Not captured: the change only shows once a 41st toast is posted while 40 are unanswered.
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR