Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Send the SDL_QUIT when last window is destroyed, not during its close…
Browse files Browse the repository at this point in the history
… event.
  • Loading branch information
icculus committed Aug 8, 2013
1 parent 760d638 commit eb8ec67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/events/SDL_windowevents.c
Expand Up @@ -197,13 +197,6 @@ SDL_SendWindowEvent(SDL_Window * window, Uint8 windowevent, int data1,
posted = (SDL_PushEvent(&event) > 0);
}

if (windowevent == SDL_WINDOWEVENT_CLOSE) {
if ( !window->prev && !window->next ) {
/* This is the last window in the list so send the SDL_QUIT event */
SDL_SendQuit();
}
}

return (posted);
}

Expand Down
5 changes: 5 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -2210,6 +2210,11 @@ SDL_DestroyWindow(SDL_Window * window)
}

SDL_free(window);

if (_this->windows == NULL) {
/* This is the last window in the list so send the SDL_QUIT event */
SDL_SendQuit();
}
}

SDL_bool
Expand Down

0 comments on commit eb8ec67

Please sign in to comment.