diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-07-26 13:22:11 +0200 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-07-26 13:22:11 +0200 |
| commit | 8e865f38489f204ea2fabf2cee3acad1a215deff (patch) | |
| tree | 892e604be56a09cd0ce2abe75cd960f1a5821b7b /Source/Core/DolphinWX/FrameTools.cpp | |
| parent | 906b05cb1c1a88c2af3d83c2cd422822abe143fe (diff) | |
| parent | 06b13f12d3c7ef9946dfba6d8aa91e9f6b1ed7d6 (diff) | |
Merge pull request #506 from Armada651/d3dfullscreen
D3D: Add exclusive fullscreen support.
Diffstat (limited to 'Source/Core/DolphinWX/FrameTools.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/FrameTools.cpp | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index b33cd4bab1..7da062645f 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -95,6 +95,7 @@ Core::GetWindowHandle(). #include "InputCommon/ControllerInterface/ControllerInterface.h" #include "VideoCommon/VideoBackendBase.h" +#include "VideoCommon/VideoConfig.h" #ifdef _WIN32 #ifndef SM_XVIRTUALSCREEN @@ -119,8 +120,6 @@ extern "C" { class InputPlugin; class wxFrame; -static bool confirmStop = false; - // Create menu items // --------------------- void CFrame::CreateMenu() @@ -976,7 +975,7 @@ void CFrame::StartGame(const std::string& filename) m_RenderFrame->Bind(wxEVT_CLOSE_WINDOW, &CFrame::OnRenderParentClose, this); m_RenderFrame->Bind(wxEVT_ACTIVATE, &CFrame::OnActive, this); m_RenderFrame->Bind(wxEVT_MOVE, &CFrame::OnRenderParentMove, this); - m_RenderParent = new CPanel(m_RenderFrame, wxID_ANY); + m_RenderParent = m_RenderFrame; m_RenderFrame->Show(); } @@ -1082,11 +1081,11 @@ void CFrame::DoStop() { if (!Core::IsRunningAndStarted()) return; - if (confirmStop) + if (m_confirmStop) return; // don't let this function run again until it finishes, or is aborted. - confirmStop = true; + m_confirmStop = true; m_bGameLoading = false; if (Core::GetState() != Core::CORE_UNINITIALIZED || @@ -1100,8 +1099,21 @@ void CFrame::DoStop() // Ask for confirmation in case the user accidentally clicked Stop / Escape if (SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop) { + // Pause the state during confirmation and restore it afterwards Core::EState state = Core::GetState(); - Core::SetState(Core::CORE_PAUSE); + + // If exclusive fullscreen is not enabled then we can pause the emulation + // before we've exited fullscreen. If not then we need to exit fullscreen first. + if (!RendererIsFullscreen() || g_Config.bBorderlessFullscreen || + SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain) + { + Core::SetState(Core::CORE_PAUSE); + } + else + { + DoFullscreen(false); + } + wxMessageDialog m_StopDlg( this, _("Do you want to stop the current emulation?"), @@ -1113,7 +1125,7 @@ void CFrame::DoStop() if (Ret != wxID_YES) { Core::SetState(state); - confirmStop = false; + m_confirmStop = false; return; } } @@ -1135,7 +1147,7 @@ void CFrame::OnStopped() { wxEndBusyCursor(); - confirmStop = false; + m_confirmStop = false; #if defined(HAVE_X11) && HAVE_X11 if (SConfig::GetInstance().m_LocalCoreStartupParameter.bDisableScreenSaver) |
