X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c5f62640d5072b3ab9116a3852294ab58ebbfbb..f86a4930f2c69058684496a1882343fe8e709bf2:/src/osx/dialog_osx.cpp?ds=sidebyside 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();