mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-13 00:58:29 +02:00
Add native fullscreen support for OS X.
This commit is contained in:
@ -798,9 +798,6 @@ void CFrame::ToggleDisplayMode(bool bFullscreen)
|
||||
#elif defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||
m_XRRConfig->ToggleDisplayMode(bFullscreen);
|
||||
#elif defined __APPLE__
|
||||
NSView* view = (NSView *)m_RenderFrame->GetHandle();
|
||||
[[view window] toggleFullScreen:[view window]];
|
||||
|
||||
if(bFullscreen)
|
||||
CGDisplayHideCursor(CGMainDisplayID());
|
||||
else
|
||||
@ -867,6 +864,13 @@ void CFrame::StartGame(const std::string& filename)
|
||||
m_RenderFrame->Show();
|
||||
}
|
||||
|
||||
#if defined(__APPLE__)
|
||||
NSView *view = (NSView *) m_RenderFrame->GetHandle();
|
||||
NSWindow *window = [view window];
|
||||
|
||||
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
#endif
|
||||
|
||||
wxBeginBusyCursor();
|
||||
|
||||
DoFullscreen(SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen);
|
||||
@ -1022,10 +1026,22 @@ void CFrame::DoStop()
|
||||
m_RenderParent->SetCursor(wxNullCursor);
|
||||
DoFullscreen(false);
|
||||
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||
{
|
||||
m_RenderFrame->Destroy();
|
||||
}
|
||||
else
|
||||
{
|
||||
#if defined(__APPLE__)
|
||||
// Disable the full screen button when not in a game.
|
||||
NSView *view = (NSView *) m_RenderFrame->GetHandle();
|
||||
NSWindow *window = [view window];
|
||||
|
||||
[window setCollectionBehavior:NSWindowCollectionBehaviorDefault];
|
||||
#endif
|
||||
|
||||
// Make sure the window is not longer set to stay on top
|
||||
m_RenderFrame->SetWindowStyle(m_RenderFrame->GetWindowStyle() & ~wxSTAY_ON_TOP);
|
||||
}
|
||||
m_RenderParent = NULL;
|
||||
|
||||
// Clean framerate indications from the status bar.
|
||||
|
Reference in New Issue
Block a user