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

Commit

Permalink
WinRT: fixed bug whereby attempting to create a 2nd window (which int…
Browse files Browse the repository at this point in the history
…entionall fails, for now) would cause mouse input to stop working
  • Loading branch information
DavidLudwig committed Oct 30, 2012
1 parent 13c72d0 commit 5d2d074
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/video/windowsrt/SDL_WinRTApp.cpp
Expand Up @@ -198,6 +198,11 @@ SDL_DisplayMode SDL_WinRTApp::GetMainDisplayMode()
return mode;
}

const SDL_WindowData * SDL_WinRTApp::GetSDLWindowData() const
{
return m_sdlWindowData;
}

bool SDL_WinRTApp::HasSDLWindowData() const
{
return (m_sdlWindowData != NULL);
Expand Down
3 changes: 2 additions & 1 deletion src/video/windowsrt/SDL_WinRTApp.h
Expand Up @@ -23,8 +23,9 @@ ref class SDL_WinRTApp sealed : public Windows::ApplicationModel::Core::IFramewo
// SDL-specific methods
SDL_DisplayMode GetMainDisplayMode();
void PumpEvents();
const SDL_WindowData * GetSDLWindowData() const;
bool HasSDLWindowData() const;
void SetSDLWindowData(const SDL_WindowData* windowData);
void SetSDLWindowData(const SDL_WindowData * windowData);

protected:
// Event Handlers.
Expand Down
3 changes: 2 additions & 1 deletion src/video/windowsrt/SDL_winrtvideo.cpp
Expand Up @@ -168,7 +168,8 @@ WINRT_CreateWindow(_THIS, SDL_Window * window)
void
WINRT_DestroyWindow(_THIS, SDL_Window * window)
{
if (SDL_WinRTGlobalApp->HasSDLWindowData())
if (SDL_WinRTGlobalApp->HasSDLWindowData() &&
SDL_WinRTGlobalApp->GetSDLWindowData()->sdlWindow == window)
{
SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
}
Expand Down

0 comments on commit 5d2d074

Please sign in to comment.