X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a456218de5b367b857226eb7f2be3cbe1b3f1bb..99030bdf57b8d590066092d2f466626f9bdef172:/src/mac/window.cpp diff --git a/src/mac/window.cpp b/src/mac/window.cpp index 85a70799c9..af2cb1118d 100644 --- a/src/mac/window.cpp +++ b/src/mac/window.cpp @@ -148,6 +148,22 @@ wxWindowMac::~wxWindowMac() m_isBeingDeleted = TRUE; +#ifndef __WXUNIVERSAL__ + // VS: make sure there's no wxFrame with last focus set to us: + for ( wxWindow *win = GetParent(); win; win = win->GetParent() ) + { + wxFrame *frame = wxDynamicCast(win, wxFrame); + if ( frame ) + { + if ( frame->GetLastFocus() == this ) + { + frame->SetLastFocus((wxWindow*)NULL); + } + break; + } + } +#endif // __WXUNIVERSAL__ + if ( s_lastMouseWindow == this ) { s_lastMouseWindow = NULL ;