Fix Toast timing and alert once per shown Toast

- ToastQueue compared times unsigned: a Toast stamped a few ms after the
  main loop read the clock looked expired, so Toasts were skipped or
  shown late and bursts chained wrongly
- Notifier now beeps and flashes when each Toast appears instead of when
  the Notification arrives, so a burst alerts once per Toast

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EhqxQ49eCju4CzKYNjZzwT
This commit is contained in:
2026-10-02 11:09:46 +02:00
co-authored by Claude Opus 5.5
parent 879cb0d0b6
commit a053b1a5de
5 changed files with 52 additions and 12 deletions
+2
View File
@@ -11,6 +11,7 @@ namespace roro {
struct Toast {
std::string text;
NotificationLevel level;
uint32_t id; // unique per push, to tell two identical Toasts apart
};
// Notifications waiting to be shown as Toasts, one at a time, each for the same duration.
@@ -34,6 +35,7 @@ class ToastQueue {
bool showing_ = false;
uint32_t shownAtMs_ = 0;
bool changed_ = false;
uint32_t nextId_ = 1;
};
} // namespace roro