diff options
-rw-r--r-- | xbmc/windowing/osx/OpenGL/OSXGLWindow.mm | 9 | ||||
-rw-r--r-- | xbmc/windowing/osx/WinSystemOSX.mm | 20 |
2 files changed, 7 insertions, 22 deletions
diff --git a/xbmc/windowing/osx/OpenGL/OSXGLWindow.mm b/xbmc/windowing/osx/OpenGL/OSXGLWindow.mm index ad5ff771c2..afe8738b60 100644 --- a/xbmc/windowing/osx/OpenGL/OSXGLWindow.mm +++ b/xbmc/windowing/osx/OpenGL/OSXGLWindow.mm @@ -136,10 +136,11 @@ - (void)windowDidChangeScreen:(NSNotification*)notification { - // user has moved the window to a - // different screen - // if (CServiceBroker::GetWinSystem()->IsFullScreen()) - // CServiceBroker::GetWinSystem()->SetMovedToOtherScreen(true); + // user has moved the window to a different screen + CWinSystemOSX* winSystem = dynamic_cast<CWinSystemOSX*>(CServiceBroker::GetWinSystem()); + if (!winSystem) + return; + winSystem->WindowChangedScreen(); } - (NSSize)windowWillResize:(NSWindow*)sender toSize:(NSSize)frameSize diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm index 023d4ce07e..90f6e969ce 100644 --- a/xbmc/windowing/osx/WinSystemOSX.mm +++ b/xbmc/windowing/osx/WinSystemOSX.mm @@ -1189,27 +1189,11 @@ void CWinSystemOSX::OnMove(int x, int y) void CWinSystemOSX::WindowChangedScreen() { - // user has moved the window to a - // different screen - NSOpenGLContext* context = [NSOpenGLContext currentContext]; - m_lastDisplayNr = 0; - // if we are here the user dragged the window to a different // screen and we return the screen of the window - if (context) + if (m_appWindow) { - NSView* view; - - view = context.view; - if (view) - { - NSWindow* window; - window = view.window; - if (window) - { - m_lastDisplayNr = GetDisplayIndex(GetDisplayIDFromScreen(window.screen)); - } - } + m_lastDisplayNr = GetDisplayIndex(GetDisplayIDFromScreen(m_appWindow.screen)); } } |