X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4c58f5c2c2b41a8ca054d69454610b1ec8c6919f..eea4d01c65f9b29baa1193db762b4c6b8144af24:/src/osx/core/display.cpp diff --git a/src/osx/core/display.cpp b/src/osx/core/display.cpp index aa292c8642..998eff23f7 100644 --- a/src/osx/core/display.cpp +++ b/src/osx/core/display.cpp @@ -93,7 +93,7 @@ static CGDisplayErr wxOSXGetDisplayList(CGDisplayCount maxDisplays, { CGDisplayErr error = kCGErrorSuccess; CGDisplayCount onlineCount; - + error = CGGetOnlineDisplayList(0,NULL,&onlineCount); if ( error == kCGErrorSuccess ) { @@ -108,7 +108,7 @@ static CGDisplayErr wxOSXGetDisplayList(CGDisplayCount maxDisplays, { if ( CGDisplayMirrorsDisplay(onlineDisplays[i]) != kCGNullDirectDisplay ) continue; - + if ( displays == NULL ) *displayCount += 1; else @@ -123,7 +123,7 @@ static CGDisplayErr wxOSXGetDisplayList(CGDisplayCount maxDisplays, } delete[] onlineDisplays; } - + } return error; } @@ -267,10 +267,14 @@ wxVideoMode wxDisplayImplMacOSX::GetCurrentMode() const bool wxDisplayImplMacOSX::ChangeMode( const wxVideoMode& mode ) { - // Changing to default mode (wxDefaultVideoMode) doesn't - // work because we don't have access to the system's 'scrn' - // resource which holds the user's mode which the system - // will return to after this app is done +#ifndef __WXOSX_IPHONE__ + if (mode == wxDefaultVideoMode) + { + CGRestorePermanentDisplayConfiguration(); + return true; + } +#endif + boolean_t bExactMatch; CFDictionaryRef theCGMode = CGDisplayBestModeForParametersAndRefreshRate( m_id,