diff --git a/uppsrc/CtrlCore/Win32Wnd.cpp b/uppsrc/CtrlCore/Win32Wnd.cpp index 9e82855ff..3f8e87ee8 100644 --- a/uppsrc/CtrlCore/Win32Wnd.cpp +++ b/uppsrc/CtrlCore/Win32Wnd.cpp @@ -629,12 +629,10 @@ void Ctrl::WndFree() void Ctrl::WndDestroy0() { GuiLock __; - LLOG("Ctrl::WndDestroy() in " <hwnd) { HWND hwnd = top->hwnd; WndFree(); // CXL 2007-06-04 to avoid loosing focus with maximize box owned dialogs - ::DestroyWindow(hwnd); + bool result = ::DestroyWindow(hwnd); } } diff --git a/uppsrc/CtrlLib/LabelBase.cpp b/uppsrc/CtrlLib/LabelBase.cpp index be9ad0b43..9b03f4d51 100644 --- a/uppsrc/CtrlLib/LabelBase.cpp +++ b/uppsrc/CtrlLib/LabelBase.cpp @@ -508,6 +508,7 @@ DisplayPopup::DisplayPopup() margin = 0; ONCELOCK { InstallStateHook(StateHook); + InstallMouseHook(MouseHook); } LinkBefore(all()); } @@ -526,7 +527,6 @@ void DisplayPopup::Sync() if(sz.cx + 2 * margin > item.GetWidth() || sz.cy > item.GetHeight()) { slim = item + ctrl->GetScreenView().TopLeft(); if(slim.Contains(GetMousePos())) { -// Rect wa = GetWorkArea(); Rect r = item; r.right = max(r.right, r.left + sz.cx + 2 * margin); r.bottom = max(r.bottom, r.top + sz.cy); @@ -551,11 +551,27 @@ Link *DisplayPopup::all() return &all; } +void DisplayPopup::SyncAll() +{ + int n = 0; + for(DisplayPopup *p = all()->Link::GetNext(); p != all(); p = p->Link::GetNext()) + if(p->ctrl && p->ctrl->IsOpen()) { + p->Sync(); + n++; + } +} + bool DisplayPopup::StateHook(Ctrl *, int reason) { if(reason == FOCUS) - for(DisplayPopup *p = all()->Link::GetNext(); p != all(); p = p->Link::GetNext()) - p->Sync(); + SyncAll(); + return false; +} + + +bool DisplayPopup::MouseHook(Ctrl *, bool, int, Point, int, dword) +{ + SyncAll(); return false; } diff --git a/uppsrc/CtrlLib/LabelBase.h b/uppsrc/CtrlLib/LabelBase.h index 4def3e11c..7e5909c9a 100644 --- a/uppsrc/CtrlLib/LabelBase.h +++ b/uppsrc/CtrlLib/LabelBase.h @@ -129,6 +129,8 @@ private: static Link *all(); static bool StateHook(Ctrl *, int reason); + static bool MouseHook(Ctrl *, bool, int, Point, int, dword); + static void SyncAll(); public: void Set(Ctrl *ctrl, const Rect& item, const Value& v, const Display *display,