From 0f876f047aaf539773f028f89f4f33ff0059b178 Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Tue, 9 Oct 2007 15:29:50 +0000 Subject: [PATCH] removing interference between two layering fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49109 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dialog.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index 64f666e418..aad117e59b 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -145,16 +145,16 @@ void wxDialog::DoShowModal() SetFocus() ; -#if TARGET_CARBON WindowRef windowRef = (WindowRef) MacGetWindowRef(); - WindowGroupRef formerGroup = GetWindowGroup(windowRef) ; - SetWindowGroup( windowRef, GetWindowGroupOfClass( kMovableModalWindowClass )); + WindowGroupRef windowGroup; + WindowGroupRef formerParentGroup; + if ( GetParent() == NULL ) + { + windowGroup = GetWindowGroup(windowRef) ; + formerParentGroup = GetWindowGroupParent( windowGroup ); + SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) ); + } BeginAppModalStateForWindow(windowRef) ; -#else - // TODO : test whether parent gets disabled - bool formerModal = s_macIsInModalLoop ; - s_macIsInModalLoop = true ; -#endif while ( IsModalShowing() ) { @@ -162,13 +162,11 @@ void wxDialog::DoShowModal() // calls process idle itself } -#if TARGET_CARBON EndAppModalStateForWindow(windowRef) ; - SetWindowGroup( windowRef, formerGroup ); -#else - // TODO probably reenable the parent window if any - s_macIsInModalLoop = formerModal ; -#endif + if ( GetParent() == NULL ) + { + SetWindowGroupParent( windowGroup , formerParentGroup ); + } }