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
This commit is contained in:
Soren Jorvang 2011-01-31 14:34:46 +00:00
parent ad71303007
commit 51eae3f41a
2 changed files with 11 additions and 6 deletions

View File

@ -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)

View File

@ -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
}