]> git.saurik.com Git - wxWidgets.git/commitdiff
make sure we are removing ourselves from the focus of the toplevel frame when deletin...
authorStefan Csomor <csomor@advancedconcepts.ch>
Sun, 26 May 2002 07:53:42 +0000 (07:53 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Sun, 26 May 2002 07:53:42 +0000 (07:53 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15669 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/mac/carbon/window.cpp
src/mac/window.cpp

index 85a70799c9ece02776feae589b7df08f5cbc2a21..af2cb1118d72e1a4c1d17aa71413f958517cafe9 100644 (file)
@@ -148,6 +148,22 @@ wxWindowMac::~wxWindowMac()
     
     m_isBeingDeleted = TRUE;
 
     
     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 ;
     if ( s_lastMouseWindow == this )
     {
         s_lastMouseWindow = NULL ;
index 85a70799c9ece02776feae589b7df08f5cbc2a21..af2cb1118d72e1a4c1d17aa71413f958517cafe9 100644 (file)
@@ -148,6 +148,22 @@ wxWindowMac::~wxWindowMac()
     
     m_isBeingDeleted = TRUE;
 
     
     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 ;
     if ( s_lastMouseWindow == this )
     {
         s_lastMouseWindow = NULL ;