bring the parent of a wxFRAME_FLOAT_ON_PARENT frame to the top when deleting it as Windows doesn't do it automatically
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15756 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -473,6 +473,19 @@ wxTopLevelWindowMSW::~wxTopLevelWindowMSW()
|
||||
if ( wxModelessWindows.Find(this) )
|
||||
wxModelessWindows.DeleteObject(this);
|
||||
|
||||
// after destroying an owned window, Windows activates the next top level
|
||||
// window in Z order but it may be different from our owner (to reproduce
|
||||
// this simply Alt-TAB to another application and back before closing the
|
||||
// owned frame) whereas we always want to yield activation to our parent
|
||||
if ( HasFlag(wxFRAME_FLOAT_ON_PARENT) )
|
||||
{
|
||||
wxWindow *parent = GetParent();
|
||||
if ( parent )
|
||||
{
|
||||
::BringWindowToTop(GetHwndOf(parent));
|
||||
}
|
||||
}
|
||||
|
||||
// If this is the last top-level window, exit.
|
||||
if ( wxTheApp && (wxTopLevelWindows.Number() == 0) )
|
||||
{
|
||||
@@ -757,10 +770,13 @@ long wxTopLevelWindowMSW::HandleNcActivate(bool activate)
|
||||
long
|
||||
wxTopLevelWindowMSW::MSWWindowProc(WXUINT msg, WXWPARAM wParam, WXLPARAM lParam)
|
||||
{
|
||||
if ( msg == WM_NCACTIVATE && HandleNcActivate(wParam != 0) )
|
||||
if ( msg == WM_NCACTIVATE )
|
||||
{
|
||||
// we processed WM_NCACTIVATE ourselves
|
||||
return TRUE;
|
||||
if ( HandleNcActivate(wParam != 0) )
|
||||
{
|
||||
// we processed WM_NCACTIVATE ourselves
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return wxTopLevelWindowBase::MSWWindowProc(msg, wParam, lParam);
|
||||
|
Reference in New Issue
Block a user