Merge pull request #4499 from ligfx/msgalertmainthread

DolphinWX: pass wxMsgAlert to main thread on non-GTK too
This commit is contained in:
Matthew Parlane 2017-01-13 09:52:09 +13:00 committed by GitHub
commit 22546aef37
3 changed files with 2 additions and 7 deletions

View File

@ -703,7 +703,6 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
m_RenderParent->SetCursor(wxCURSOR_BLANK); m_RenderParent->SetCursor(wxCURSOR_BLANK);
break; break;
#ifdef __WXGTK__
case IDM_PANIC: case IDM_PANIC:
{ {
wxString caption = event.GetString().BeforeFirst(':'); wxString caption = event.GetString().BeforeFirst(':');
@ -713,7 +712,6 @@ void CFrame::OnHostMessage(wxCommandEvent& event)
panic_event.Set(); panic_event.Set();
} }
break; break;
#endif
case WM_USER_STOP: case WM_USER_STOP:
DoStop(); DoStop();

View File

@ -116,9 +116,10 @@ public:
const CGameListCtrl* GetGameListCtrl() const; const CGameListCtrl* GetGameListCtrl() const;
wxMenuBar* GetMenuBar() const override; wxMenuBar* GetMenuBar() const override;
#ifdef __WXGTK__
Common::Event panic_event; Common::Event panic_event;
bool bPanicResult; bool bPanicResult;
#ifdef __WXGTK__
std::recursive_mutex keystate_lock; std::recursive_mutex keystate_lock;
#endif #endif

View File

@ -352,10 +352,8 @@ void DolphinApp::OnIdle(wxIdleEvent& ev)
bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/) bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*/)
{ {
#ifdef __WXGTK__
if (wxIsMainThread()) if (wxIsMainThread())
{ {
#endif
NetPlayDialog*& npd = NetPlayDialog::GetInstance(); NetPlayDialog*& npd = NetPlayDialog::GetInstance();
if (npd != nullptr && npd->IsShown()) 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, return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption), (yes_no) ? wxYES_NO : wxOK,
wxWindow::FindFocus()); wxWindow::FindFocus());
#ifdef __WXGTK__
} }
else else
{ {
@ -375,7 +372,6 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style*
main_frame->panic_event.Wait(); main_frame->panic_event.Wait();
return main_frame->bPanicResult; return main_frame->bPanicResult;
} }
#endif
} }
std::string wxStringTranslator(const char* text) std::string wxStringTranslator(const char* text)