Add an API and backends for system notifications#15351
Draft
Kontrabant wants to merge 6 commits intolibsdl-org:mainfrom
Draft
Add an API and backends for system notifications#15351Kontrabant wants to merge 6 commits intolibsdl-org:mainfrom
Kontrabant wants to merge 6 commits intolibsdl-org:mainfrom
Conversation
d53972e to
ef3fe10
Compare
sezero
reviewed
Apr 9, 2026
sezero
reviewed
Apr 9, 2026
ef3fe10 to
d27ce06
Compare
7256624 to
ea0bf0e
Compare
Use the core and portal notification implementations to dispatch system notifications.
Notifications are supported on Win10 and above.
Supported on macOS 10.14+ and iOS.
ea0bf0e to
c752640
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notifications are asynchronous, passive popups that convey some information to the user. This adds support for various native system notifications and an associated SDL API.
Tested and supported platforms:
Needs testing:
Possible future backends:
All implementations currently support some basic features in addition to header and body text:
Feedback from actions comes in the form of a new event, which returns the invoked action string specified when the notification was dispatched. It can also return a "default" action, if the notification is interacted with in a non-specific way (e.g. tapping or clicking on the body instead of a button).
New capabilities can be easily added by adding additional properties. A simple interface that just takes a title, body, and image, is included as well.
The Windows implementation also provides a situation where SDL_wcstoul() is needed, so that was added in a separate commit, along with associated tests.
Closes #7857 (supersedes)
Closes #1932