From 95864c665336157a01d78a96fa2acbc1de610b68 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 9 Feb 2014 17:13:19 +0000 Subject: [PATCH] Turtle: Fixed issue with focus on WndDestroy #682 git-svn-id: svn://ultimatepp.org/upp/trunk@6890 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Turtle/Ctrl.cpp | 10 +--------- uppsrc/Turtle/Wnd.cpp | 3 ++- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/uppsrc/Turtle/Ctrl.cpp b/uppsrc/Turtle/Ctrl.cpp index d1d930c75..2daeb0588 100644 --- a/uppsrc/Turtle/Ctrl.cpp +++ b/uppsrc/Turtle/Ctrl.cpp @@ -65,15 +65,7 @@ void GuiPlatformAfterMenuPopUp() } String Ctrl::Name() const { - GuiLock __; -#ifdef CPU_64 - String s = String(typeid(*this).name()) + " : 0x" + FormatIntHex(this); -#else - String s = String(typeid(*this).name()) + " : " + Format("0x%x", (int) this); -#endif - if(IsChild()) - s << "(parent " << String(typeid(*parent).name()) << ")"; - return s; + return Name0(); } END_UPP_NAMESPACE diff --git a/uppsrc/Turtle/Wnd.cpp b/uppsrc/Turtle/Wnd.cpp index 180da8f8c..e037b417b 100644 --- a/uppsrc/Turtle/Wnd.cpp +++ b/uppsrc/Turtle/Wnd.cpp @@ -274,8 +274,9 @@ void Ctrl::DestroyWnd() void Ctrl::WndDestroy() { + bool focus = HasFocusDeep(); DestroyWnd(); - if(topctrl.GetCount()) + if(focus && topctrl.GetCount()) topctrl.Top()->ActivateWnd(); }