From 443815df166f3460f9c9f211f4b597d52b8bbd72 Mon Sep 17 00:00:00 2001 From: Michael Maltese Date: Tue, 6 Dec 2016 16:39:04 -0800 Subject: [PATCH] DolphinWX: pass wxMsgAlert to main thread on non-GTK too Fixes an issue on macOS where wxMessageBox always returns wxCANCEL when not called from main thread. --- Source/Core/DolphinWX/Frame.cpp | 2 -- Source/Core/DolphinWX/Frame.h | 3 ++- Source/Core/DolphinWX/Main.cpp | 4 ---- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/Source/Core/DolphinWX/Frame.cpp b/Source/Core/DolphinWX/Frame.cpp index 200b495a11..8a83d4f223 100644 --- a/Source/Core/DolphinWX/Frame.cpp +++ b/Source/Core/DolphinWX/Frame.cpp @@ -701,7 +701,6 @@ void CFrame::OnHostMessage(wxCommandEvent& event) m_RenderParent->SetCursor(wxCURSOR_BLANK); break; -#ifdef __WXGTK__ case IDM_PANIC: { wxString caption = event.GetString().BeforeFirst(':'); @@ -711,7 +710,6 @@ void CFrame::OnHostMessage(wxCommandEvent& event) panic_event.Set(); } break; -#endif case WM_USER_STOP: DoStop(); diff --git a/Source/Core/DolphinWX/Frame.h b/Source/Core/DolphinWX/Frame.h index faa3e320f8..98f60c200a 100644 --- a/Source/Core/DolphinWX/Frame.h +++ b/Source/Core/DolphinWX/Frame.h @@ -116,9 +116,10 @@ public: const CGameListCtrl* GetGameListCtrl() const; wxMenuBar* GetMenuBar() const override; -#ifdef __WXGTK__ Common::Event panic_event; bool bPanicResult; + +#ifdef __WXGTK__ std::recursive_mutex keystate_lock; #endif diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index d8ae2bc364..e32e6c9968 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -352,10 +352,8 @@ void DolphinApp::OnIdle(wxIdleEvent& ev) bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/) { -#ifdef __WXGTK__ if (wxIsMainThread()) { -#endif NetPlayDialog*& npd = NetPlayDialog::GetInstance(); if (npd != nullptr && npd->IsShown()) { @@ -364,7 +362,6 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style* } return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption), (yes_no) ? wxYES_NO : wxOK, wxWindow::FindFocus()); -#ifdef __WXGTK__ } else { @@ -375,7 +372,6 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style* main_frame->panic_event.Wait(); return main_frame->bPanicResult; } -#endif } std::string wxStringTranslator(const char* text)