Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

WinRT: hack-fixed a bug whereby SDL_UpdateWindowSurface would fail if…

… the app was hidden, then re-shown
  • Loading branch information
DavidLudwig committed Jan 23, 2013
1 parent a35236d commit dc0df53ffdc5d2f8c4271db628cad694f9dff00f
Showing with 10 additions and 0 deletions.
  1. +10 −0 src/video/windowsrt/SDL_WinRTApp.cpp
@@ -152,11 +152,21 @@ void SDL_WinRTApp::OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEven
{
m_windowVisible = args->Visible;
if (m_sdlWindowData) {
SDL_bool wasSDLWindowSurfaceValid = m_sdlWindowData->sdlWindow->surface_valid;

if (args->Visible) {
SDL_SendWindowEvent(m_sdlWindowData->sdlWindow, SDL_WINDOWEVENT_SHOWN, 0, 0);
} else {
SDL_SendWindowEvent(m_sdlWindowData->sdlWindow, SDL_WINDOWEVENT_HIDDEN, 0, 0);
}

// HACK: Prevent SDL's window-hide handling code, which currently
// triggers a fake window resize (possibly erronously), from
// marking the SDL window's surface as invalid.
//
// A better solution to this probably involves figuring out if the
// fake window resize can be prevented.
m_sdlWindowData->sdlWindow->surface_valid = wasSDLWindowSurfaceValid;
}
}

0 comments on commit dc0df53

Please sign in to comment.