mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Merge pull request #726 from Armada651/ogl-exclusive
CFrame: Add fullscreen window styles to enable exclusive mode in OpenGL.
This commit is contained in:
commit
7b9c8da468
@ -191,6 +191,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.
|
||||
|
@ -58,6 +58,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);
|
||||
|
@ -1072,6 +1072,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();
|
||||
|
||||
@ -1082,10 +1085,6 @@ void CFrame::DoStop()
|
||||
{
|
||||
Core::SetState(Core::CORE_PAUSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoFullscreen(false);
|
||||
}
|
||||
|
||||
wxMessageDialog m_StopDlg(
|
||||
this,
|
||||
|
Loading…
x
Reference in New Issue
Block a user