Skip to content

fix(notification): defer sound until first render - #15

Merged
TrackAndTruckDevs merged 1 commit into
TrackAndTruckDevs:mainfrom
aefly:fix/notification-queued-sound
Oct 5, 2026
Merged

TrackAndTruckDevs merged 1 commit into
TrackAndTruckDevs:mainfrom
aefly:fix/notification-queued-sound

Conversation

@aefly

@aefly aefly commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Summary

When two or more plugins have an update available, the notification sound played several times in a row immediately, before the second popup appeared.

SPF_NOTIF_MODE_TOP displays only one notification at a time; the others wait in a queue. However, NotificationWindow::ShowEx played the sound as soon as the notification was enqueued. With N queued TOP notifications, the sound fired N times at once, and the later popups then appeared silently.

This affects any burst of TOP notifications (plugin update notices, framework update notice, plugin API calls).

Fix

  • Add a pendingSound flag to NotificationData.
  • ShowEx no longer plays the sound; it only sets pendingSound (same condition as before: sound enabled and mode is not STICKY).
  • RenderSingleNotification plays the sound on the notification's first render and clears the flag. Since queued TOP notifications are not rendered until they become active, each one now plays its sound when it actually appears.

STACK notifications are unaffected: they are rendered on the next frame, so their sound plays as before.

Play the message sound from `RenderSingleNotification` instead of
`ShowEx` so queued top notifications don't sound before they appear.
@TrackAndTruckDevs
TrackAndTruckDevs merged commit 3407ea2 into TrackAndTruckDevs:main Oct 5, 2026
1 check passed
@TrackAndTruckDevs

Copy link
Copy Markdown
Owner

Thanks, merged.
How critical is this fix for your MotionCab? I planned to release in a week or two, when I've written more functionality, but if it's critical I can put out a mini-release...

@aefly

aefly commented Oct 5, 2026

Copy link
Copy Markdown
Contributor Author

None, everything is good from SPF, just taking my time to release the new version, in some days.

Thanks for asking!

@aefly
aefly deleted the fix/notification-queued-sound branch October 5, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants