From 857c116210e47ac921bfab60eb6abec5738afd15 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sun, 3 Aug 2014 23:36:54 +0200 Subject: [PATCH 1/2] CFrame: Add fullscreen window styles to enable exclusive mode in OpenGL. This is not implemented within the backend, but relies purely on driver heuristics. --- Source/Core/DolphinWX/Frame.cpp | 19 +++++++++++++++++++ Source/Core/DolphinWX/Frame.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 057d20172a..f0f8db9c96 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -192,6 +192,25 @@ WXLRESULT CRenderFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPa } #endif +bool CRenderFrame::ShowFullScreen(bool show, long style) +{ + if (show) + { + // OpenGL requires the pop-up style to activate exclusive mode. + SetWindowStyle((GetWindowStyle() & ~wxDEFAULT_FRAME_STYLE) | wxPOPUP_WINDOW); + } + + bool result = wxTopLevelWindow::ShowFullScreen(show, style); + + if (!show) + { + // Restore the default style. + SetWindowStyle((GetWindowStyle() & ~wxPOPUP_WINDOW) | wxDEFAULT_FRAME_STYLE); + } + + return result; +} + // event tables // Notice that wxID_HELP will be processed for the 'About' menu and the toolbar // help button. diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h index cbf9209d65..d550ec1d0d 100644 --- a/Source/Core/DolphinWX/Frame.h +++ b/Source/Core/DolphinWX/Frame.h @@ -60,6 +60,8 @@ class CRenderFrame : public wxFrame const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE); + bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) override; + private: void OnDropFiles(wxDropFilesEvent& event); static bool IsValidSavestateDropped(const std::string& filepath); From b67ec4ea58ddf3af9fe1b6dd06a3e2c8e3a012c8 Mon Sep 17 00:00:00 2001 From: Jules Blok Date: Sun, 3 Aug 2014 23:38:20 +0200 Subject: [PATCH 2/2] CFrame: Always exit fullscreen before showing the stop dialog. --- Source/Core/DolphinWX/FrameTools.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Source/Core/DolphinWX/FrameTools.cpp b/Source/Core/DolphinWX/FrameTools.cpp index 8ef5fd19f4..4c6d2a5fa3 100644 --- a/Source/Core/DolphinWX/FrameTools.cpp +++ b/Source/Core/DolphinWX/FrameTools.cpp @@ -1099,6 +1099,9 @@ void CFrame::DoStop() // Ask for confirmation in case the user accidentally clicked Stop / Escape if (SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop) { + // Exit fullscreen to ensure it does not cover the stop dialog. + DoFullscreen(false); + // Pause the state during confirmation and restore it afterwards Core::EState state = Core::GetState(); @@ -1109,10 +1112,6 @@ void CFrame::DoStop() { Core::SetState(Core::CORE_PAUSE); } - else - { - DoFullscreen(false); - } wxMessageDialog m_StopDlg( this,