Merge pull request #6745 from spycrab/qt_fullscreen

Qt: Call Render::SetFullscreen
This commit is contained in:
Stenzek 2018-05-03 23:28:21 +10:00 committed by GitHub
commit be32602769
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -16,6 +16,7 @@
#include "Core/PowerPC/PowerPC.h"
#include "DolphinQt2/Settings.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VideoConfig.h"
Host::Host() = default;
@ -43,6 +44,8 @@ bool Host::GetRenderFocus()
void Host::SetRenderFocus(bool focus)
{
m_render_focus = focus;
if (g_renderer && m_render_fullscreen && g_ActiveConfig.ExclusiveFullscreenEnabled())
Core::RunAsCPUThread([focus] { g_renderer->SetFullscreen(focus); });
}
bool Host::GetRenderFullscreen()
@ -53,6 +56,10 @@ bool Host::GetRenderFullscreen()
void Host::SetRenderFullscreen(bool fullscreen)
{
m_render_fullscreen = fullscreen;
if (g_renderer && g_renderer->IsFullscreen() != fullscreen &&
g_ActiveConfig.ExclusiveFullscreenEnabled())
Core::RunAsCPUThread([fullscreen] { g_renderer->SetFullscreen(fullscreen); });
}
void Host::ResizeSurface(int new_width, int new_height)

View File

@ -37,7 +37,7 @@ signals:
private:
Host();
std::atomic<void*> m_render_handle;
std::atomic<bool> m_render_focus;
std::atomic<bool> m_render_fullscreen;
std::atomic<void*> m_render_handle{nullptr};
std::atomic<bool> m_render_focus{false};
std::atomic<bool> m_render_fullscreen{false};
};