tray: renamed SDL_HasNoActiveTrays() to SDL_HasActiveTrays()

This commit is contained in:
Sam Lantinga
2025-01-19 16:29:58 -08:00
parent a974888aad
commit d4cda51057
4 changed files with 5 additions and 5 deletions

View File

@@ -247,7 +247,7 @@ bool SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent, int data
break; 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; int toplevel_count = 0;
SDL_Window *n; SDL_Window *n;
for (n = SDL_GetVideoDevice()->windows; n; n = n->next) { for (n = SDL_GetVideoDevice()->windows; n; n = n->next) {

View File

@@ -85,7 +85,7 @@ void SDL_CleanupTrays(void)
SDL_free(trays); SDL_free(trays);
} }
bool SDL_HasNoActiveTrays(void) bool SDL_HasActiveTrays(void)
{ {
return active_trays == 0; return (active_trays > 0);
} }

View File

@@ -23,4 +23,4 @@
extern void SDL_RegisterTray(SDL_Tray *tray); extern void SDL_RegisterTray(SDL_Tray *tray);
extern void SDL_UnregisterTray(SDL_Tray *tray); extern void SDL_UnregisterTray(SDL_Tray *tray);
extern void SDL_CleanupTrays(void); extern void SDL_CleanupTrays(void);
extern bool SDL_HasNoActiveTrays(void); extern bool SDL_HasActiveTrays(void);

View File

@@ -790,7 +790,7 @@ void SDL_DestroyTray(SDL_Tray *tray)
SDL_free(tray); SDL_free(tray);
if (SDL_HasNoActiveTrays()) { if (!SDL_HasActiveTrays()) {
gtk_main_quit(); gtk_main_quit();
gtk_thread_active = false; gtk_thread_active = false;
} }