Add an API and backends for system notifications#15351
Open
Kontrabant wants to merge 7 commits intolibsdl-org:mainfrom
Open
Add an API and backends for system notifications#15351Kontrabant wants to merge 7 commits intolibsdl-org:mainfrom
Kontrabant wants to merge 7 commits intolibsdl-org:mainfrom
Conversation
d53972e to
ef3fe10
Compare
sezero
reviewed
Apr 9, 2026
sezero
reviewed
Apr 9, 2026
ef3fe10 to
d27ce06
Compare
c752640 to
391c8dc
Compare
391c8dc to
0d56d7b
Compare
Contributor
Author
|
Fixed a few memory leaks, and revamped the data structure used to add "actions" to notifications, so it can be easily extended in the future to support additional types. The basic design here is complete, so I'm removing draft status. |
slouken
reviewed
Apr 20, 2026
slouken
reviewed
Apr 20, 2026
slouken
reviewed
Apr 20, 2026
slouken
reviewed
Apr 20, 2026
slouken
reviewed
Apr 20, 2026
slouken
reviewed
Apr 20, 2026
slouken
reviewed
Apr 20, 2026
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.
0d56d7b to
d9a5652
Compare
slouken
reviewed
Apr 23, 2026
Collaborator
|
I haven't done a thorough review, but in general this looks good to me. @icculus, thoughts? |
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