diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.h b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.h index 09525ab323..35a013e4c9 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.h +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.h @@ -3,9 +3,12 @@ #include "LowLevelWindow.h" #include "RageDisplay.h" +#include -typedef struct objc_object *id; typedef const struct __CFDictionary *CFDictionaryRef; +/* XXX: This was changed to a uint32_t later and its header file cannot be included + * since Style conflicts. Ugh. */ +typedef struct _CGDirectDisplayID *CGDirectDisplayID; class LowLevelWindow_MacOSX : public LowLevelWindow { @@ -14,6 +17,7 @@ class LowLevelWindow_MacOSX : public LowLevelWindow id m_Context; id m_BGContext; CFDictionaryRef m_CurrentDisplayMode; + CGDirectDisplayID m_DisplayID; public: LowLevelWindow_MacOSX(); diff --git a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm index 615f95743c..f6920ecd29 100644 --- a/stepmania/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm +++ b/stepmania/src/arch/LowLevelWindow/LowLevelWindow_MacOSX.mm @@ -287,7 +287,8 @@ void RenderTarget_MacOSX::FinishRenderingTo() m_OldContext = nil; } -LowLevelWindow_MacOSX::LowLevelWindow_MacOSX() : m_Context(nil), m_BGContext(nil), m_CurrentDisplayMode(NULL) + +LowLevelWindow_MacOSX::LowLevelWindow_MacOSX() : m_Context(nil), m_BGContext(nil), m_CurrentDisplayMode(NULL), m_DisplayID(0) { POOL; m_WindowDelegate = [[SMWindowDelegate alloc] init]; @@ -453,7 +454,7 @@ void LowLevelWindow_MacOSX::ShutDownFullScreen() ASSERT( err == kCGErrorSuccess ); CGDisplayShowCursor( kCGDirectMainDisplay ); - err = CGReleaseAllDisplays(); + err = CGDisplayRelease( m_DisplayID ); ASSERT( err == kCGErrorSuccess ); SetActualParamsFromMode( m_CurrentDisplayMode ); // We don't own this so we cannot release it. @@ -469,7 +470,8 @@ int LowLevelWindow_MacOSX::ChangeDisplayMode( const VideoModeParams& p ) if( !m_CurrentDisplayMode ) { - if( (err = CGCaptureAllDisplays()) != kCGErrorSuccess ) + m_DisplayID = CGMainDisplayID(); + if( (err = CGDisplayCapture(m_DisplayID)) != kCGErrorSuccess ) return err; // Only hide the first time we go to full screen. CGDisplayHideCursor( kCGDirectMainDisplay );