X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1d156af3247c862e51a7c62f569a3fd302052a42..d4e5c5b98a5a80c5cc65776f2add32ff543c2972:/src/osx/dialog_osx.cpp diff --git a/src/osx/dialog_osx.cpp b/src/osx/dialog_osx.cpp index 835afaaa24..cb127f323b 100644 --- a/src/osx/dialog_osx.cpp +++ b/src/osx/dialog_osx.cpp @@ -13,6 +13,7 @@ #include "wx/dialog.h" #include "wx/evtloop.h" +#include "wx/modalhook.h" #ifndef WX_PRECOMP #include "wx/app.h" @@ -115,7 +116,12 @@ bool wxDialog::Show(bool show) if ( !show ) { - switch( m_modality ) + const int modalityOrig = m_modality; + + // complete the 'hiding' before we send the event + m_modality = wxDIALOG_MODALITY_NONE; + + switch ( modalityOrig ) { case wxDIALOG_MODALITY_WINDOW_MODAL: EndWindowModal(); // OS X implementation method for cleanup @@ -124,7 +130,6 @@ bool wxDialog::Show(bool show) default: break; } - m_modality = wxDIALOG_MODALITY_NONE; } return true; @@ -133,6 +138,8 @@ bool wxDialog::Show(bool show) // Replacement for Show(true) for modal dialogs - returns return code int wxDialog::ShowModal() { + WX_HOOK_MODAL_DIALOG(); + m_modality = wxDIALOG_MODALITY_APP_MODAL; Show();