Skip to content

Commit

Permalink
Windows SDL 1.x: Move DIB window parent shutdown to SQL_Quit. Don't s…
Browse files Browse the repository at this point in the history
…hutdown parent window with SQL_QuitSubSystem(). This fixes a problem where DOSBox-X's OpenGL initialization causes the window to disappear, and then reappear, often below the next active window on the desktop.
  • Loading branch information
joncampbell123 committed Feb 1, 2018
1 parent f57d201 commit 06b6f02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions vs2015/sdl/src/SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ void SDL_Quit(void)
#endif
SDL_QuitSubSystem(SDL_INIT_EVERYTHING);

#if defined(WIN32)
// windib
void StopParentWindow(void);
StopParentWindow();
#endif

#ifdef CHECK_LEAKS
#ifdef DEBUG_BUILD
printf("[SDL_Quit] : CHECK_LEAKS\n"); fflush(stdout);
Expand Down
4 changes: 3 additions & 1 deletion vs2015/sdl/src/video/windib/SDL_dibevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -974,7 +974,9 @@ void DIB_DestroyWindow(_THIS)
DestroyWindow(SDL_Window);
}

StopParentWindow();
// NTS: DOSBox-X likes to call SQL_Quit/SQL_QuitSubSystem just to reinit the window.
// It's better if the parent window doesn't disappear and reappear.
// StopParentWindow();

SDL_UnregisterApp();

Expand Down

0 comments on commit 06b6f02

Please sign in to comment.