mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-01 10:39:45 -06:00
Let the Renderer decide when to exit fullscreen.
This ensures the transition from/to exclusive mode happens while the RenderFrame is fullscreen. This prevents fullscreen loops and relieves us of having to restore the window size after we exit fullscreen.
This commit is contained in:
@ -640,6 +640,11 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
|
||||
}
|
||||
break;
|
||||
|
||||
case IDM_FULLSCREENREQUEST:
|
||||
if (m_RenderFrame != nullptr)
|
||||
m_RenderFrame->ShowFullScreen(event.GetInt() == 0 ? false : true);
|
||||
break;
|
||||
|
||||
case WM_USER_CREATE:
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||
m_RenderParent->SetCursor(wxCURSOR_BLANK);
|
||||
@ -1185,7 +1190,18 @@ void CFrame::DoFullscreen(bool bF)
|
||||
[window toggleFullScreen:nil];
|
||||
}
|
||||
#else
|
||||
m_RenderFrame->ShowFullScreen(bF, wxFULLSCREEN_ALL);
|
||||
if (bF)
|
||||
{
|
||||
m_RenderFrame->ShowFullScreen(true, wxFULLSCREEN_ALL);
|
||||
}
|
||||
else if (!g_ActiveConfig.backend_info.bSupportsExclusiveFullscreen ||
|
||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain ||
|
||||
g_ActiveConfig.bForceBorderlessFullscreen)
|
||||
{
|
||||
// Exiting exclusive fullscreen should be done from a Renderer callback.
|
||||
// Therefore we don't exit fullscreen from here if we support exclusive mode.
|
||||
m_RenderFrame->ShowFullScreen(false, wxFULLSCREEN_ALL);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||
|
@ -256,6 +256,7 @@ enum
|
||||
IDM_WINDOWSIZEREQUEST,
|
||||
IDM_STOPPED,
|
||||
IDM_HOST_MESSAGE,
|
||||
IDM_FULLSCREENREQUEST,
|
||||
|
||||
IDM_MPANEL, ID_STATUSBAR,
|
||||
|
||||
|
@ -627,6 +627,13 @@ void Host_RequestRenderWindowSize(int width, int height)
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
void Host_RequestFullscreen(bool fullscreen)
|
||||
{
|
||||
wxCommandEvent event(wxEVT_HOST_COMMAND, IDM_FULLSCREENREQUEST);
|
||||
event.SetInt(fullscreen ? 1 : 0);
|
||||
main_frame->GetEventHandler()->AddPendingEvent(event);
|
||||
}
|
||||
|
||||
void Host_SetStartupDebuggingParameters()
|
||||
{
|
||||
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||
|
@ -94,6 +94,9 @@ void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
|
||||
}
|
||||
|
||||
void Host_RequestRenderWindowSize(int width, int height) {}
|
||||
|
||||
void Host_RequestFullscreen(bool fullscreen) {}
|
||||
|
||||
void Host_SetStartupDebuggingParameters()
|
||||
{
|
||||
}
|
||||
|
@ -88,6 +88,9 @@ void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
|
||||
}
|
||||
|
||||
void Host_RequestRenderWindowSize(int width, int height) {}
|
||||
|
||||
void Host_RequestFullscreen(bool fullscreen) {}
|
||||
|
||||
void Host_SetStartupDebuggingParameters()
|
||||
{
|
||||
SCoreStartupParameter& StartUp = SConfig::GetInstance().m_LocalCoreStartupParameter;
|
||||
|
Reference in New Issue
Block a user