From d6d4a1a9838624d490ea5aa64b27e47951ba53e9 Mon Sep 17 00:00:00 2001 From: Jonathan Li Date: Mon, 22 Jun 2015 18:56:31 +0100 Subject: [PATCH] linux: wx3.0: fix broken messagebox handling Do not do additional processing on an event after EndModal is called. This fixes a message box bug on Linux wx3.0 builds. Without this fix, Release and Devel builds emit cancel signals even if 'Ok' or other buttons are pressed, and Debug builds trip an assertion with the message "EndModal called twice or ShowModal not called." --- pcsx2/gui/Dialogs/ConfirmationDialogs.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pcsx2/gui/Dialogs/ConfirmationDialogs.cpp b/pcsx2/gui/Dialogs/ConfirmationDialogs.cpp index 7756e97d88..70d1f3e48a 100644 --- a/pcsx2/gui/Dialogs/ConfirmationDialogs.cpp +++ b/pcsx2/gui/Dialogs/ConfirmationDialogs.cpp @@ -298,10 +298,11 @@ ModalButtonPanel::ModalButtonPanel( wxWindow* parent, const MsgButtons& buttons void ModalButtonPanel::OnActionButtonClicked( wxCommandEvent& evt ) { - evt.Skip(); wxWindow* toplevel = wxGetTopLevelParent( this ); if( wxDialog* dialog = wxDynamicCast( toplevel, wxDialog ) ) dialog->EndModal( evt.GetId() ); + // If the dialog doesn't close, and you're using it for a modeless dialog - hint: + // read the name of the class. ;) } void ModalButtonPanel::AddCustomButton( wxWindowID id, const wxString& label )