Skip to content

Commit d4cda51

Browse files
committed
tray: renamed SDL_HasNoActiveTrays() to SDL_HasActiveTrays()
1 parent a974888 commit d4cda51

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/events/SDL_windowevents.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ bool SDL_SendWindowEvent(SDL_Window *window, SDL_EventType windowevent, int data
247247
break;
248248
}
249249

250-
if (windowevent == SDL_EVENT_WINDOW_CLOSE_REQUESTED && !window->parent && SDL_HasNoActiveTrays()) {
250+
if (windowevent == SDL_EVENT_WINDOW_CLOSE_REQUESTED && !window->parent && !SDL_HasActiveTrays()) {
251251
int toplevel_count = 0;
252252
SDL_Window *n;
253253
for (n = SDL_GetVideoDevice()->windows; n; n = n->next) {

src/tray/SDL_tray_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void SDL_CleanupTrays(void)
8585
SDL_free(trays);
8686
}
8787

88-
bool SDL_HasNoActiveTrays(void)
88+
bool SDL_HasActiveTrays(void)
8989
{
90-
return active_trays == 0;
90+
return (active_trays > 0);
9191
}

src/tray/SDL_tray_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323
extern void SDL_RegisterTray(SDL_Tray *tray);
2424
extern void SDL_UnregisterTray(SDL_Tray *tray);
2525
extern void SDL_CleanupTrays(void);
26-
extern bool SDL_HasNoActiveTrays(void);
26+
extern bool SDL_HasActiveTrays(void);

src/tray/unix/SDL_tray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ void SDL_DestroyTray(SDL_Tray *tray)
790790

791791
SDL_free(tray);
792792

793-
if (SDL_HasNoActiveTrays()) {
793+
if (!SDL_HasActiveTrays()) {
794794
gtk_main_quit();
795795
gtk_thread_active = false;
796796
}

0 commit comments

Comments
 (0)