From 574468c95bcbff781166ac429160e4d9fa01097a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Thu, 21 Jul 2016 16:36:27 +0200 Subject: [PATCH] Don't pipe PanicAlerts to netplay window if it isn't opened This is something that was quite confusing for me while trying to get netplay to work for me; once the Connect/Host buttons were pressed, the UI would hang, only to work again a few seconds later, but with no error message or explanation *at all*. Turns out this is because panic alerts are shown in the netplay window instead during netplay, even before it is even shown. This fixes it by "piping" the alerts to the netplay chat only if the netplay window is visible. (regression introduced in #3823) --- Source/Core/DolphinWX/Main.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/Core/DolphinWX/Main.cpp b/Source/Core/DolphinWX/Main.cpp index a9a7af6854..20460e258c 100644 --- a/Source/Core/DolphinWX/Main.cpp +++ b/Source/Core/DolphinWX/Main.cpp @@ -372,16 +372,13 @@ bool wxMsgAlert(const char* caption, const char* text, bool yes_no, int /*Style* { #endif NetPlayDialog*& npd = NetPlayDialog::GetInstance(); - if (npd == nullptr) - { - return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption), - (yes_no) ? wxYES_NO : wxOK, wxWindow::FindFocus()); - } - else + if (npd != nullptr && npd->IsShown()) { npd->AppendChat("/!\\ " + std::string{text}); return true; } + return wxYES == wxMessageBox(StrToWxStr(text), StrToWxStr(caption), (yes_no) ? wxYES_NO : wxOK, + wxWindow::FindFocus()); #ifdef __WXGTK__ } else