Skip to content
Snippets Groups Projects
Commit 9007986f authored by Oliver Behnke's avatar Oliver Behnke
Browse files

Try and prevent premature fullscreen exits

* Sometimes window events are received prematurely (probably caused by the initial window resizing)
* Ignore window events until the window is actually visible
parent effbd3b5
No related branches found
No related tags found
No related merge requests found
......@@ -276,11 +276,14 @@ void WindowManager::eventLoop()
(event.type == SDL_MOUSEMOTION || event.type == SDL_MOUSEBUTTONDOWN ||
event.type == SDL_KEYDOWN)) {
// don't handle events prematurely
if((SDL_GetWindowFlags(m_Window) & SDL_WINDOW_SHOWN)) {
// we're in screensaver mode so exit on user input
SDL_GL_DeleteContext(m_GLContext);
SDL_DestroyWindow(m_Window);
SDL_Quit();
}
}
else if (event.motion.state & (SDL_BUTTON(1) | SDL_BUTTON(3)) &&
event.type == SDL_MOUSEMOTION) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment