diff options
author | Damien Plisson <damien.plisson@yahoo.fr> | 2010-03-16 23:42:12 +0300 |
---|---|---|
committer | Damien Plisson <damien.plisson@yahoo.fr> | 2010-03-16 23:42:12 +0300 |
commit | 8ac0359852f1eb8597bfc847c5a4891d61adae20 (patch) | |
tree | e725def144c4976023378d58bc24c1985254ffee /intern | |
parent | bcca4e6843df452c820fa48845adc3872e3331ad (diff) |
Fix [#21634] GHOST_WindowCocoa: activeWindow null pointer check
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemCocoa.mm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index bcbc59a34a9..20d5cc7165a 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -774,15 +774,17 @@ GHOST_IWindow* GHOST_SystemCocoa::createWindow( GHOST_TSuccess GHOST_SystemCocoa::beginFullScreen(const GHOST_DisplaySetting& setting, GHOST_IWindow** window, const bool stereoVisual) { GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow(); - *window = currentWindow; + if(!currentWindow) return GHOST_kFailure; + return currentWindow->setState(GHOST_kWindowStateFullScreen); } GHOST_TSuccess GHOST_SystemCocoa::endFullScreen(void) { GHOST_IWindow* currentWindow = m_windowManager->getActiveWindow(); + if(!currentWindow) return GHOST_kFailure; return currentWindow->setState(GHOST_kWindowStateNormal); } @@ -809,6 +811,8 @@ GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 { float xf=(float)x, yf=(float)y; GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow(); + if (!window) return GHOST_kFailure; + NSScreen *windowScreen = window->getScreen(); NSRect screenRect = [windowScreen frame]; |