From af77752fc08969fc0d4b7e1151fbf9707272b596 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 22 Jan 2004 11:26:20 +0000 Subject: [PATCH] don't crash when restoring focus after showing a modal dialog git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dialog.cpp | 19 +------------------ src/mac/dialog.cpp | 19 +------------------ 2 files changed, 2 insertions(+), 36 deletions(-) diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index ad9de2c969..581c50198f 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -167,18 +167,8 @@ void wxDialog::DoShowModal() wxModalDialogs.Append(this); - wxWindow *parent = GetParent(); + wxWindow *parent = GetParent(); - // remember where the focus was - wxWindow *winFocus = FindFocus(); - if ( !winFocus ) - { - winFocus = parent; - } - if ( !winFocus ) - { - winFocus = wxTheApp->GetTopWindow(); - } #if TARGET_CARBON BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ; #else @@ -198,13 +188,6 @@ void wxDialog::DoShowModal() // TODO probably reenable the parent window if any s_macIsInModalLoop = formerModal ; #endif - - - // and restore focus - if ( winFocus ) - { - winFocus->SetFocus(); - } } diff --git a/src/mac/dialog.cpp b/src/mac/dialog.cpp index ad9de2c969..581c50198f 100644 --- a/src/mac/dialog.cpp +++ b/src/mac/dialog.cpp @@ -167,18 +167,8 @@ void wxDialog::DoShowModal() wxModalDialogs.Append(this); - wxWindow *parent = GetParent(); + wxWindow *parent = GetParent(); - // remember where the focus was - wxWindow *winFocus = FindFocus(); - if ( !winFocus ) - { - winFocus = parent; - } - if ( !winFocus ) - { - winFocus = wxTheApp->GetTopWindow(); - } #if TARGET_CARBON BeginAppModalStateForWindow( (WindowRef) MacGetWindowRef()) ; #else @@ -198,13 +188,6 @@ void wxDialog::DoShowModal() // TODO probably reenable the parent window if any s_macIsInModalLoop = formerModal ; #endif - - - // and restore focus - if ( winFocus ) - { - winFocus->SetFocus(); - } } -- 2.47.2