]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/core/display.cpp
Use $(OutDir) instead of explicit directories in VC10 project files.
[wxWidgets.git] / src / osx / core / display.cpp
index aa292c86429fc63762b7c5272008df7c113184b0..b1961bc92e3a69248e4b9f477122425948e291a4 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Ryan Norton & Brian Victor
 // Modified by: Royce Mitchell III, Vadim Zeitlin
 // Created:     06/21/02
-// RCS-ID:      $Id$
 // Copyright:   (c) wxWidgets team
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -93,7 +92,7 @@ static CGDisplayErr wxOSXGetDisplayList(CGDisplayCount maxDisplays,
 {
     CGDisplayErr error = kCGErrorSuccess;
     CGDisplayCount onlineCount;
-    
+
     error = CGGetOnlineDisplayList(0,NULL,&onlineCount);
     if ( error == kCGErrorSuccess )
     {
@@ -108,7 +107,7 @@ static CGDisplayErr wxOSXGetDisplayList(CGDisplayCount maxDisplays,
                 {
                     if ( CGDisplayMirrorsDisplay(onlineDisplays[i]) != kCGNullDirectDisplay )
                         continue;
-                    
+
                     if ( displays == NULL )
                         *displayCount += 1;
                     else
@@ -123,7 +122,7 @@ static CGDisplayErr wxOSXGetDisplayList(CGDisplayCount maxDisplays,
             }
             delete[] onlineDisplays;
         }
-            
+
     }
     return error;
 }
@@ -267,10 +266,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,