D3D: Fix Dolphin immediately exiting exclusive fullscreen.

This commit is contained in:
Jules Blok
2015-01-16 16:01:29 +01:00
parent c2bdcbe71c
commit 803bea5004

View File

@ -891,21 +891,11 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
// we can apply exclusive mode. // we can apply exclusive mode.
fullscreen_changed = Host_RendererHasFocus(); fullscreen_changed = Host_RendererHasFocus();
} }
else if (!fullscreen) else if (!fullscreen && exclusive_mode)
{
if (exclusive_mode)
{ {
// Exclusive fullscreen is disabled, but we're still in exclusive mode. // Exclusive fullscreen is disabled, but we're still in exclusive mode.
fullscreen_changed = true; 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);
}
}
} }
// Resize the back buffers NOW to avoid flickering // Resize the back buffers NOW to avoid flickering
@ -924,8 +914,14 @@ void Renderer::SwapImpl(u32 xfbAddr, u32 fbWidth, u32 fbStride, u32 fbHeight, co
{ {
// Apply fullscreen state // Apply fullscreen state
if (fullscreen_changed) if (fullscreen_changed)
{
D3D::SetFullscreenState(fullscreen); D3D::SetFullscreenState(fullscreen);
// If exclusive fullscreen is disabled we can safely notify the UI to exit fullscreen.
if (!fullscreen)
Host_RequestFullscreen(false);
}
// TODO: Aren't we still holding a reference to the back buffer right now? // TODO: Aren't we still holding a reference to the back buffer right now?
D3D::Reset(); D3D::Reset();
SAFE_RELEASE(s_screenshot_texture); SAFE_RELEASE(s_screenshot_texture);