WinRT: fixed bug whereby attempting to create a 2nd window (which intentionall fails, for now) would cause mouse input to stop working
authorDavid Ludwig <dludwig@pobox.com>
Mon, 29 Oct 2012 23:32:13 -0400
changeset 8335 4f41add2ff00
parent 8334 09b0670fece4
child 8336 0b9aa42be7ae
WinRT: fixed bug whereby attempting to create a 2nd window (which intentionall fails, for now) would cause mouse input to stop working
src/video/windowsrt/SDL_WinRTApp.cpp
src/video/windowsrt/SDL_WinRTApp.h
src/video/windowsrt/SDL_winrtvideo.cpp
--- a/src/video/windowsrt/SDL_WinRTApp.cpp	Sun Oct 28 23:20:18 2012 -0400
+++ b/src/video/windowsrt/SDL_WinRTApp.cpp	Mon Oct 29 23:32:13 2012 -0400
@@ -198,6 +198,11 @@
     return mode;
 }
 
+const SDL_WindowData * SDL_WinRTApp::GetSDLWindowData() const
+{
+    return m_sdlWindowData;
+}
+
 bool SDL_WinRTApp::HasSDLWindowData() const
 {
     return (m_sdlWindowData != NULL);
--- a/src/video/windowsrt/SDL_WinRTApp.h	Sun Oct 28 23:20:18 2012 -0400
+++ b/src/video/windowsrt/SDL_WinRTApp.h	Mon Oct 29 23:32:13 2012 -0400
@@ -23,8 +23,9 @@
     // 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.
--- a/src/video/windowsrt/SDL_winrtvideo.cpp	Sun Oct 28 23:20:18 2012 -0400
+++ b/src/video/windowsrt/SDL_winrtvideo.cpp	Mon Oct 29 23:32:13 2012 -0400
@@ -168,7 +168,8 @@
 void
 WINRT_DestroyWindow(_THIS, SDL_Window * window)
 {
-    if (SDL_WinRTGlobalApp->HasSDLWindowData())
+    if (SDL_WinRTGlobalApp->HasSDLWindowData() &&
+        SDL_WinRTGlobalApp->GetSDLWindowData()->sdlWindow == window)
     {
         SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
     }