Permalink
Browse files

Qt: Call Render::SetFullscreen

  • Loading branch information...
spycrab committed May 3, 2018
1 parent 467379c commit 68e2b46ba1371222cf5965f92a15bd4e01131db8
Showing with 10 additions and 3 deletions.
  1. +7 −0 Source/Core/DolphinQt2/Host.cpp
  2. +3 −3 Source/Core/DolphinQt2/Host.h
@@ -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)
@@ -37,7 +37,7 @@ class Host final : public QObject
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};
};

0 comments on commit 68e2b46

Please sign in to comment.