@@ -247,7 +247,7 @@ bool SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent, int data
break;
}
- if (windowevent == SDL_EVENT_WINDOW_CLOSE_REQUESTED && !window->parent && SDL_HasNoActiveTrays()) {
+ if (windowevent == SDL_EVENT_WINDOW_CLOSE_REQUESTED && !window->parent && !SDL_HasActiveTrays()) {
int toplevel_count = 0;
SDL_Window *n;
for (n = SDL_GetVideoDevice()->windows; n; n = n->next) {
@@ -85,7 +85,7 @@ void SDL_CleanupTrays(void)
SDL_free(trays);
-bool SDL_HasNoActiveTrays(void)
+bool SDL_HasActiveTrays(void)
{
- return active_trays == 0;
+ return (active_trays > 0);
@@ -23,4 +23,4 @@
extern void SDL_RegisterTray(SDL_Tray *tray);
extern void SDL_UnregisterTray(SDL_Tray *tray);
extern void SDL_CleanupTrays(void);
-extern bool SDL_HasNoActiveTrays(void);
+extern bool SDL_HasActiveTrays(void);
@@ -790,7 +790,7 @@ void SDL_DestroyTray(SDL_Tray *tray)
SDL_free(tray);
- if (SDL_HasNoActiveTrays()) {
+ if (!SDL_HasActiveTrays()) {
gtk_main_quit();
gtk_thread_active = false;