Skip to content

Add SDL_IsTraySupported #13124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2025
Merged

Add SDL_IsTraySupported #13124

merged 1 commit into from
Jul 21, 2025

Conversation

Semphriss
Copy link
Contributor

Description

Allows detecting whether or not trays should be supported, without having to create a tray icon.

I added a note that it's not a guarantee that it will/won't work when calling SDL_CreateTray, and that the availability may vary with time.

Existing Issue(s)

Fixes #13119

@icculus
Copy link
Collaborator

icculus commented Jul 17, 2025

I'd probably take out the documentation comment about how this can change during the course of the program if system libraries change...I think that's beyond our scope.

In fact, I'd just cache the result after the first check, on platforms where it isn't universally true.

@Semphriss
Copy link
Contributor Author

I updated the code; is it fine if I do the caching stuff in the platform implementations, or should I add something like SDL_SYS_IsTraySupported and use a global function to do the caching for all platforms?

@icculus
Copy link
Collaborator

icculus commented Jul 21, 2025

should I add something like SDL_SYS_IsTraySupported

I would prefer this because it matches what we do in other subsystems (and I would move the check for the main thread there, too, even if a backend doesn't strictly require it, so behavior is consistent across platforms), but that's a task for the future; this PR can land as-is.

@icculus icculus merged commit 47d8bdd into libsdl-org:main Jul 21, 2025
41 checks passed
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.

SDL_UnregisterTray unexpectedly triggers SDL_EVENT_QUIT event (Create/Destroy tray for feature detection)
2 participants