From 5cd9237f3a32e6c0b42c63386f559b3d87f4a884 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 31 Oct 2007 23:31:35 +0000 Subject: [PATCH] Ensure we don't reset the group parent if it wasn't set at the begining git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@49570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/dialog.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mac/carbon/dialog.cpp b/src/mac/carbon/dialog.cpp index aad117e59b..114be10e4e 100644 --- a/src/mac/carbon/dialog.cpp +++ b/src/mac/carbon/dialog.cpp @@ -148,11 +148,14 @@ void wxDialog::DoShowModal() WindowRef windowRef = (WindowRef) MacGetWindowRef(); WindowGroupRef windowGroup; WindowGroupRef formerParentGroup; + bool resetGroupParent = false; + if ( GetParent() == NULL ) { windowGroup = GetWindowGroup(windowRef) ; formerParentGroup = GetWindowGroupParent( windowGroup ); SetWindowGroupParent( windowGroup, GetWindowGroupOfClass( kMovableModalWindowClass ) ); + resetGroupParent = true; } BeginAppModalStateForWindow(windowRef) ; @@ -163,7 +166,7 @@ void wxDialog::DoShowModal() } EndAppModalStateForWindow(windowRef) ; - if ( GetParent() == NULL ) + if ( resetGroupParent ) { SetWindowGroupParent( windowGroup , formerParentGroup ); }