From 51eae3f41abeea9fdbdd2ad218b568d4412f3c8f Mon Sep 17 00:00:00 2001 From: Soren Jorvang Date: Mon, 31 Jan 2011 14:34:46 +0000 Subject: [PATCH] Capture the display before switching the display resolution so other windows under the fullscreen one won't get resized to fit a lower fullscreen resolution. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7021 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/DolphinWX/Src/ConfigMain.cpp | 2 -- Source/Core/DolphinWX/Src/FrameTools.cpp | 15 +++++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Source/Core/DolphinWX/Src/ConfigMain.cpp b/Source/Core/DolphinWX/Src/ConfigMain.cpp index 431dbfa093..042e868022 100644 --- a/Source/Core/DolphinWX/Src/ConfigMain.cpp +++ b/Source/Core/DolphinWX/Src/ConfigMain.cpp @@ -1394,8 +1394,6 @@ void CConfigMain::AddResolutions() kCGDisplayBitsPerPixel); CFNumberGetValue(ref, kCFNumberIntType, &d); - if (CFDictionaryContainsKey(mode, kCGDisplayModeIsInterlaced)) - continue; if (CFDictionaryContainsKey(mode, kCGDisplayModeIsStretched)) continue; if (d != 32) diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 8b373145a8..2acb2dab12 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -773,6 +773,12 @@ void CFrame::ToggleDisplayMode(bool bFullscreen) #elif defined(HAVE_XRANDR) && HAVE_XRANDR m_XRRConfig->ToggleDisplayMode(bFullscreen); #elif defined __APPLE__ + if (!bFullscreen) { + CGRestorePermanentDisplayConfiguration(); + CGDisplayRelease(CGMainDisplayID()); + return; + } + CFArrayRef modes = CGDisplayAvailableModes(CGMainDisplayID()); for (CFIndex i = 0; i < CFArrayGetCount(modes); i++) { @@ -792,14 +798,15 @@ void CFrame::ToggleDisplayMode(bool bFullscreen) kCGDisplayBitsPerPixel); CFNumberGetValue(ref, kCFNumberIntType, &d); + if (CFDictionaryContainsKey(mode, kCGDisplayModeIsStretched)) + continue; if (w != x || h != y || d != 32) continue;; - if (bFullscreen) - CGDisplaySwitchToMode(CGMainDisplayID(), mode); - else - CGRestorePermanentDisplayConfiguration(); + CGDisplayCapture(CGMainDisplayID()); + CGDisplaySwitchToMode(CGMainDisplayID(), mode); } + #endif }