Open
Description
SDL: 3.2.10
The problem
I have logic in my Zig application where I create a tray with SDL_CreateTray
and then destroy it with SDL_DestroyTray
on start-up to detect if the operating system supports the feature.
Calling SDL_DestroyTray
has unexpected behaviour where it calls SDL_UnregisterTray
which sends an SDL_EVENT_QUIT
event because it detects that are no more windows active and it immediately closes the application on the first-frame.
Lines 64 to 66 in d4cda51
Workarounds for others that find this
- If you want to do this check, create your application window first.
- Temporarily disable the hint
SDL_HINT_QUIT_ON_LAST_WINDOW_CLOSE
Lines 48 to 50 in d4cda51
Proposed solutions
- A new function to detect if trays are supported.
SDL_HasTraySupport
or something. - Avoid triggering quit unless a window has at least been created once or only trigger if the event queue has been polled at least once.
Metadata
Metadata
Assignees
Labels
No labels