X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/313901f3e5b6c2b91ba7040e5fe2ac67b0ffa9cb..b5435dccd098ae153c3b7b3b8fca8dd0d763986c:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 44b80d4354..8c5390cc5c 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -191,7 +191,7 @@ bool wxDialog::IsModal() const bool wxDialog::IsModalShowing() const { - return wxModalDialogs.Find((wxDialog *)this) != NULL; // const_cast + return wxModalDialogs.Find(wxConstCast(this, wxDialog)) != NULL; } wxWindow *wxDialog::FindSuitableParent() const @@ -333,6 +333,10 @@ bool wxDialog::Show(bool show) // this will cause IsModalShowing() return FALSE and our local // message loop will terminate wxModalDialogs.DeleteObject(this); + + // ensure that there is another message for this window so the + // ShowModal loop will exit and won't get stuck in GetMessage(). + ::PostMessage(GetHwnd(), WM_NULL, 0, 0); } }