From: Stefan Csomor Date: Sun, 26 May 2002 07:53:42 +0000 (+0000) Subject: make sure we are removing ourselves from the focus of the toplevel frame when deletin... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/d4380aafddd41fcb56fc787c19a710bf79d45311?ds=sidebyside make sure we are removing ourselves from the focus of the toplevel frame when deleting (copied from msw) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 85a70799c9..af2cb1118d 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/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 ; 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 ;