diff options
| author | Markus Wick <markus+github@selfnet.de> | 2015-01-19 23:29:43 +0100 |
|---|---|---|
| committer | Markus Wick <markus+github@selfnet.de> | 2015-01-19 23:29:43 +0100 |
| commit | 0d0f7ec662212e0f890e14549c564de3b9a7bc03 (patch) | |
| tree | c3dfc1ada306ea4bd7af7996884493f7418c4e36 /Source/Core/VideoBackends/D3D/Render.cpp | |
| parent | 7376956c922a33266cc59afb3ff05f8825ac32ba (diff) | |
| parent | 332d5888eb612107576c3ecba7daa1aab46a3cf6 (diff) | |
Merge pull request #1894 from Armada651/exclusive-fix
D3D: Fix Dolphin immediately exiting exclusive fullscreen.
Diffstat (limited to 'Source/Core/VideoBackends/D3D/Render.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/D3D/Render.cpp | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/Source/Core/VideoBackends/D3D/Render.cpp b/Source/Core/VideoBackends/D3D/Render.cpp index 1ae034bdda..268a408022 100644 --- a/Source/Core/VideoBackends/D3D/Render.cpp +++ b/Source/Core/VideoBackends/D3D/Render.cpp @@ -862,7 +862,7 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co SetWindowSize(fbStride, fbHeight); const bool windowResized = CheckForResize(); - const bool fullscreen = g_ActiveConfig.bFullscreen && + const bool fullscreen = g_ActiveConfig.bFullscreen && !g_ActiveConfig.bBorderlessFullscreen && !SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain; bool xfbchanged = s_last_xfb_mode != g_ActiveConfig.bUseRealXFB; @@ -885,26 +885,21 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co { if (fullscreen && !exclusive_mode) { + if (g_Config.bExclusiveMode) + OSD::AddMessage("Lost exclusive fullscreen."); + // 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) + else if (!fullscreen && exclusive_mode) { - if (exclusive_mode) - { - // Exclusive fullscreen is disabled, but we're still in exclusive mode. - fullscreen_changed = true; - } - else if (!g_ActiveConfig.bBorderlessFullscreen && Host_RendererIsFullscreen()) - { - // Exclusive fullscreen is disabled and we are no longer in exclusive - // mode. Thus we can now safely notify the UI to exit fullscreen. But - // we should only do so if borderless fullscreen mode is disabled. - Host_RequestFullscreen(false); - } + // Exclusive fullscreen is disabled, but we're still in exclusive mode. + fullscreen_changed = true; } } @@ -924,8 +919,19 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co { // Apply fullscreen state if (fullscreen_changed) + { + g_Config.bExclusiveMode = fullscreen; + + if (fullscreen) + OSD::AddMessage("Entered exclusive fullscreen."); + D3D::SetFullscreenState(fullscreen); + // If fullscreen is disabled we can safely notify the UI to exit fullscreen. + if (!g_ActiveConfig.bFullscreen) + Host_RequestFullscreen(false); + } + // TODO: Aren't we still holding a reference to the back buffer right now? D3D::Reset(); SAFE_RELEASE(s_screenshot_texture); |
