diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 662739863c..d90db5a28d 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -1319,13 +1319,11 @@ void CFrame::OnMouse(wxMouseEvent& event) void CFrame::DoFullscreen(bool enable_fullscreen) { - if (g_Config.ExclusiveFullscreenEnabled() && - !SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain && - Core::GetState() == Core::CORE_PAUSE) + if (g_Config.bExclusiveMode && Core::GetState() == Core::CORE_PAUSE) { // A responsive renderer is required for exclusive fullscreen, but the // renderer can only respond in the running state. Therefore we ignore - // fullscreen switches if we support exclusive fullscreen, but the + // fullscreen switches if we are in exclusive fullscreen, but the // renderer is not running. // TODO: Allow the renderer to switch fullscreen modes while paused. return; @@ -1346,11 +1344,10 @@ void CFrame::DoFullscreen(bool enable_fullscreen) { m_RenderFrame->ShowFullScreen(true, wxFULLSCREEN_ALL); } - else if (!g_Config.ExclusiveFullscreenEnabled() || - SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) + else if (!g_Config.bExclusiveMode) { // Exiting exclusive fullscreen should be done from a Renderer callback. - // Therefore we don't exit fullscreen from here if we support exclusive mode. + // Therefore we don't exit fullscreen from here if we are in exclusive mode. m_RenderFrame->ShowFullScreen(false, wxFULLSCREEN_ALL); } #endif diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 7f3728a03a..268a408022 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -43,7 +43,6 @@ namespace DX11 static u32 s_last_multisample_mode = 0; static bool s_last_stereo_mode = false; static bool s_last_xfb_mode = false; -static bool s_last_fullscreen = false; static Television s_television; @@ -231,7 +230,6 @@ Renderer::Renderer(void *&window_handle) s_last_efb_scale = g_ActiveConfig.iEFBScale; s_last_stereo_mode = g_ActiveConfig.iStereoMode > 0; s_last_xfb_mode = g_ActiveConfig.bUseRealXFB; - s_last_fullscreen = g_ActiveConfig.bFullscreen; CalculateTargetSize(s_backbuffer_width, s_backbuffer_height); SetupDeviceObjects(); @@ -887,16 +885,16 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co { if (fullscreen && !exclusive_mode) { - if (s_last_fullscreen) + if (g_Config.bExclusiveMode) OSD::AddMessage("Lost exclusive fullscreen."); - s_last_fullscreen = false; - // Exclusive fullscreen is enabled in the configuration, but we're // not in exclusive mode. Either exclusive fullscreen was turned on // or the render frame lost focus. When the render frame is in focus // we can apply exclusive mode. fullscreen_changed = Host_RendererHasFocus(); + + g_Config.bExclusiveMode = false; } else if (!fullscreen && exclusive_mode) { @@ -922,7 +920,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co // Apply fullscreen state if (fullscreen_changed) { - s_last_fullscreen = fullscreen; + g_Config.bExclusiveMode = fullscreen; if (fullscreen) OSD::AddMessage("Entered exclusive fullscreen."); diff --git a/Source/Core/VideoCommon/VideoConfig.cpp b/Source/Core/VideoCommon/VideoConfig.cpp index dd3d7e54a6..f0bba36ffd 100644 --- a/Source/Core/VideoCommon/VideoConfig.cpp +++ b/Source/Core/VideoCommon/VideoConfig.cpp @@ -28,7 +28,10 @@ void UpdateActiveConfig() VideoConfig::VideoConfig() { bRunning = false; + + // Exclusive fullscreen flags bFullscreen = false; + bExclusiveMode = false; // Needed for the first frame, I think fAspectRatioHackW = 1; diff --git a/Source/Core/VideoCommon/VideoConfig.h b/Source/Core/VideoCommon/VideoConfig.h index 50ff640e35..f156ddcfc8 100644 --- a/Source/Core/VideoCommon/VideoConfig.h +++ b/Source/Core/VideoCommon/VideoConfig.h @@ -67,6 +67,7 @@ struct VideoConfig final // General bool bVSync; bool bFullscreen; + bool bExclusiveMode; bool bRunning; bool bWidescreenHack; int iAspectRatio;