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 83354f41add2ff00
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
     1.1 --- a/src/video/windowsrt/SDL_WinRTApp.cpp	Sun Oct 28 23:20:18 2012 -0400
     1.2 +++ b/src/video/windowsrt/SDL_WinRTApp.cpp	Mon Oct 29 23:32:13 2012 -0400
     1.3 @@ -198,6 +198,11 @@
     1.4      return mode;
     1.5  }
     1.6  
     1.7 +const SDL_WindowData * SDL_WinRTApp::GetSDLWindowData() const
     1.8 +{
     1.9 +    return m_sdlWindowData;
    1.10 +}
    1.11 +
    1.12  bool SDL_WinRTApp::HasSDLWindowData() const
    1.13  {
    1.14      return (m_sdlWindowData != NULL);
     2.1 --- a/src/video/windowsrt/SDL_WinRTApp.h	Sun Oct 28 23:20:18 2012 -0400
     2.2 +++ b/src/video/windowsrt/SDL_WinRTApp.h	Mon Oct 29 23:32:13 2012 -0400
     2.3 @@ -23,8 +23,9 @@
     2.4      // SDL-specific methods
     2.5      SDL_DisplayMode GetMainDisplayMode();
     2.6      void PumpEvents();
     2.7 +    const SDL_WindowData * GetSDLWindowData() const;
     2.8      bool HasSDLWindowData() const;
     2.9 -    void SetSDLWindowData(const SDL_WindowData* windowData);
    2.10 +    void SetSDLWindowData(const SDL_WindowData * windowData);
    2.11  
    2.12  protected:
    2.13  	// Event Handlers.
     3.1 --- a/src/video/windowsrt/SDL_winrtvideo.cpp	Sun Oct 28 23:20:18 2012 -0400
     3.2 +++ b/src/video/windowsrt/SDL_winrtvideo.cpp	Mon Oct 29 23:32:13 2012 -0400
     3.3 @@ -168,7 +168,8 @@
     3.4  void
     3.5  WINRT_DestroyWindow(_THIS, SDL_Window * window)
     3.6  {
     3.7 -    if (SDL_WinRTGlobalApp->HasSDLWindowData())
     3.8 +    if (SDL_WinRTGlobalApp->HasSDLWindowData() &&
     3.9 +        SDL_WinRTGlobalApp->GetSDLWindowData()->sdlWindow == window)
    3.10      {
    3.11          SDL_WinRTGlobalApp->SetSDLWindowData(NULL);
    3.12      }