diff options
author | Memphiz <memphis@machzwo.de> | 2013-10-29 14:56:12 -0700 |
---|---|---|
committer | Memphiz <memphis@machzwo.de> | 2013-10-29 14:56:12 -0700 |
commit | 0403fb41552347811d3cc33fd4e7804b0c9f1e82 (patch) | |
tree | 2a37d148512ab4f45ae48c1186fac8061a59c498 | |
parent | 378d331f9a6d52ce02bc0dcfd209764e4694bdfc (diff) | |
parent | 9cf10c5095374966a013706e27a4b8a7c683c88a (diff) |
Merge pull request #3517 from Memphiz/mousemavericks
[osx/mavericks] - ugly hacked fix for the mouse bug (mouse wasn't able t...
-rw-r--r-- | xbmc/windowing/osx/WinSystemOSX.h | 1 | ||||
-rw-r--r-- | xbmc/windowing/osx/WinSystemOSX.mm | 24 |
2 files changed, 24 insertions, 1 deletions
diff --git a/xbmc/windowing/osx/WinSystemOSX.h b/xbmc/windowing/osx/WinSystemOSX.h index af0713f05d..6b9e0fb564 100644 --- a/xbmc/windowing/osx/WinSystemOSX.h +++ b/xbmc/windowing/osx/WinSystemOSX.h @@ -42,6 +42,7 @@ public: virtual bool CreateNewWindow(const CStdString& name, bool fullScreen, RESOLUTION_INFO& res, PHANDLE_EVENT_FUNC userFunction); virtual bool DestroyWindow(); virtual bool ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop); + bool ResizeWindowInternal(int newWidth, int newHeight, int newLeft, int newTop, void *additional); virtual bool SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool blankOtherDisplays); virtual void UpdateResolutions(); virtual void NotifyAppFocusChange(bool bGaining); diff --git a/xbmc/windowing/osx/WinSystemOSX.mm b/xbmc/windowing/osx/WinSystemOSX.mm index afeb6ed2c3..880a0c9842 100644 --- a/xbmc/windowing/osx/WinSystemOSX.mm +++ b/xbmc/windowing/osx/WinSystemOSX.mm @@ -700,6 +700,28 @@ bool CWinSystemOSX::DestroyWindow() } extern "C" void SDL_SetWidthHeight(int w, int h); +bool CWinSystemOSX::ResizeWindowInternal(int newWidth, int newHeight, int newLeft, int newTop, void *additional) +{ + bool ret = ResizeWindow(newWidth, newHeight, newLeft, newTop); + + // there is no NSAppKitVersionNumber10_9 out there anywhere + // so we detect mavericks by one of these newly added app nap + // methods - and fix the ugly mouse rect problem which was hitting + // us when mavericks came out + if( [NSProcessInfo instancesRespondToSelector:@selector(beginActivityWithOptions:reason:)]) + { + CLog::Log(LOGDEBUG, "Detected Mavericks - enable mouse fixup"); + NSView * last_view = (NSView *)additional; + if (last_view && [last_view window]) + { + NSWindow* lastWindow = [last_view window]; + [lastWindow setContentSize:NSMakeSize(m_nWidth, m_nHeight)]; + [lastWindow update]; + [last_view setFrameSize:NSMakeSize(m_nWidth, m_nHeight)]; + } + } + return ret; +} bool CWinSystemOSX::ResizeWindow(int newWidth, int newHeight, int newLeft, int newTop) { if (!m_glContext) @@ -984,7 +1006,7 @@ bool CWinSystemOSX::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool bl ShowHideNSWindow([last_view window], needtoshowme); // need to make sure SDL tracks any window size changes - ResizeWindow(m_nWidth, m_nHeight, -1, -1); + ResizeWindowInternal(m_nWidth, m_nHeight, -1, -1, last_view); return true; } |