summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorBraden <Bradenb95@gmail.com>2013-03-18 21:40:46 -0500
committerBraden <Bradenb95@gmail.com>2013-03-18 21:40:46 -0500
commitbefe6e696212ea7f997302f3233442c4f18cc890 (patch)
treed04fd5e50c6867d2c8718c9058f456d60333fea0 /Source/Core
parent7c2c4662a74354a5e4554dd68c7110a58651e0d0 (diff)
Short,sweet and fixes issue 5725
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/Src/FrameTools.cpp42
1 files changed, 7 insertions, 35 deletions
diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp
index d41fe96a14..f9d737d05e 100644
--- a/Source/Core/DolphinWX/Src/FrameTools.cpp
+++ b/Source/Core/DolphinWX/Src/FrameTools.cpp
@@ -35,7 +35,7 @@ Core::GetWindowHandle().
#include "VideoBackendBase.h"
#ifdef __APPLE__
-#include <ApplicationServices/ApplicationServices.h>
+#include <AppKit/AppKit.h>
#endif
#include "Globals.h" // Local
@@ -805,41 +805,13 @@ void CFrame::ToggleDisplayMode(bool bFullscreen)
#elif defined(HAVE_XRANDR) && HAVE_XRANDR
m_XRRConfig->ToggleDisplayMode(bFullscreen);
#elif defined __APPLE__
- if (!bFullscreen) {
- CGRestorePermanentDisplayConfiguration();
- CGDisplayRelease(CGMainDisplayID());
+ NSView* view = (NSView *)m_RenderFrame->GetHandle();
+ [[view window] toggleFullScreen:[view window]];
+
+ if(bFullscreen)
+ CGDisplayHideCursor(CGMainDisplayID());
+ else
CGDisplayShowCursor(CGMainDisplayID());
- return;
- }
-
- CGDisplayHideCursor(CGMainDisplayID());
- CFArrayRef modes = CGDisplayAvailableModes(CGMainDisplayID());
- for (CFIndex i = 0; i < CFArrayGetCount(modes); i++)
- {
- CFDictionaryRef mode;
- CFNumberRef ref;
- int x, y, w, h, d;
-
- sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.\
- strFullscreenResolution.c_str(), "%dx%d", &x, &y);
-
- mode = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i);
- ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayWidth);
- CFNumberGetValue(ref, kCFNumberIntType, &w);
- ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayHeight);
- CFNumberGetValue(ref, kCFNumberIntType, &h);
- ref = (CFNumberRef)CFDictionaryGetValue(mode,
- kCGDisplayBitsPerPixel);
- CFNumberGetValue(ref, kCFNumberIntType, &d);
-
- if (CFDictionaryContainsKey(mode, kCGDisplayModeIsStretched))
- continue;
- if (w != x || h != y || d != 32)
- continue;;
-
- CGDisplaySwitchToMode(CGMainDisplayID(), mode);
- }
-
#endif
}