diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2014-09-05 22:15:10 -0700 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2014-09-05 22:21:09 -0700 |
| commit | 7308b809d8d57020d18b82b8718d24877e2b6581 (patch) | |
| tree | 9b0fffd554a9bcf7c8506a55c21bf8bd99e4122b /Source/Core/DolphinWX/Frame.cpp | |
| parent | 387e1e3f21ae65c65fcd90b2c8aa21d9eff7d382 (diff) | |
Fix render to main crashing in fullscreen.
When hiding the menubar (for going fullscreen with render to main),
keep a functionally-duplicate menubar around for servicing menubar
actions.
Diffstat (limited to 'Source/Core/DolphinWX/Frame.cpp')
| -rw-r--r-- | Source/Core/DolphinWX/Frame.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 7885986fb2..5a2c09b7fd 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -318,7 +318,7 @@ CFrame::CFrame(wxFrame* parent, long style) : CRenderFrame(parent, id, title, pos, size, style) , g_pCodeWindow(nullptr), g_NetPlaySetupDiag(nullptr), g_CheatsWindow(nullptr) - , m_SavedPerspectives(nullptr), m_ToolBar(nullptr) + , m_menubar_shadow(nullptr), m_SavedPerspectives(nullptr), m_ToolBar(nullptr) , m_GameListCtrl(nullptr), m_Panel(nullptr) , m_RenderFrame(nullptr), m_RenderParent(nullptr) , m_LogWindow(nullptr), m_LogConfigWindow(nullptr) @@ -353,7 +353,10 @@ CFrame::CFrame(wxFrame* parent, GetStatusBar()->Hide(); // Give it a menu bar - CreateMenu(); + wxMenuBar* menubar_active = CreateMenu(); + SetMenuBar(menubar_active); + // Create a menubar to service requests while the real menubar is hidden from the screen + m_menubar_shadow = CreateMenu(); // --------------- // Main panel @@ -450,6 +453,10 @@ CFrame::~CFrame() ClosePages(); delete m_Mgr; + + // This object is owned by us, not wxw + m_menubar_shadow->Destroy(); + m_menubar_shadow = nullptr; } bool CFrame::RendererIsFullscreen() @@ -1271,9 +1278,9 @@ void CFrame::DoFullscreen(bool enable_fullscreen) DoToggleToolbar(SConfig::GetInstance().m_InterfaceToolbar); // Recreate the menubar if needed. - if (GetMenuBar() == nullptr) + if (wxFrame::GetMenuBar() == nullptr) { - CreateMenu(); + SetMenuBar(CreateMenu()); } // Show statusbar if enabled |
