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

Commit

Permalink
WinRT: hack-fixed a bug whereby SDL_UpdateWindowSurface would fail if…
Browse files Browse the repository at this point in the history
… the app was hidden, then re-shown
  • Loading branch information
DavidLudwig committed Jan 23, 2013
1 parent a35236d commit dc0df53
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/video/windowsrt/SDL_WinRTApp.cpp
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit dc0df53

Please sign in to comment.