tray: fixed multi-threading issues with GTk implementation

GTK+ documentation states that all GDK and GTK+ calls should be made from the main thread.

Fixes https://github.com/libsdl-org/SDL/issues/11984
This commit is contained in:
Sam Lantinga
2025-01-19 16:33:05 -08:00
parent dfdc120268
commit 5f2dd5f04e
9 changed files with 64 additions and 47 deletions

View File

@@ -498,6 +498,17 @@ extern SDL_DECLSPEC SDL_TrayEntry *SDLCALL SDL_GetTrayMenuParentEntry(SDL_TrayMe
*/
extern SDL_DECLSPEC SDL_Tray *SDLCALL SDL_GetTrayMenuParentTray(SDL_TrayMenu *menu);
/**
* Update the trays.
*
* This is called automatically by the event loop and is only needed if you're using trays but aren't handling SDL events.
*
* \since This function is available since SDL 3.2.0.
*
* \threadsafety This function should only be called on the main thread.
*/
extern SDL_DECLSPEC void SDLCALL SDL_UpdateTrays(void);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}