mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
*CtrlLib: Improved syncing of DisplayPopup to avoid stall popups (e.g. in ide navigator)
git-svn-id: svn://ultimatepp.org/upp/trunk@4714 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
d92d97f96f
commit
6e958b4c4f
3 changed files with 22 additions and 6 deletions
|
|
@ -629,12 +629,10 @@ void Ctrl::WndFree()
|
|||
void Ctrl::WndDestroy0()
|
||||
{
|
||||
GuiLock __;
|
||||
LLOG("Ctrl::WndDestroy() in " <<UPP::Name(this) << LOG_BEGIN);
|
||||
LLOG((DumpWindowOrder(false), ""));
|
||||
if(top && top->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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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> *DisplayPopup::all()
|
|||
return &all;
|
||||
}
|
||||
|
||||
void DisplayPopup::SyncAll()
|
||||
{
|
||||
int n = 0;
|
||||
for(DisplayPopup *p = all()->Link<DisplayPopup>::GetNext(); p != all(); p = p->Link<DisplayPopup>::GetNext())
|
||||
if(p->ctrl && p->ctrl->IsOpen()) {
|
||||
p->Sync();
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
bool DisplayPopup::StateHook(Ctrl *, int reason)
|
||||
{
|
||||
if(reason == FOCUS)
|
||||
for(DisplayPopup *p = all()->Link<DisplayPopup>::GetNext(); p != all(); p = p->Link<DisplayPopup>::GetNext())
|
||||
p->Sync();
|
||||
SyncAll();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool DisplayPopup::MouseHook(Ctrl *, bool, int, Point, int, dword)
|
||||
{
|
||||
SyncAll();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -129,6 +129,8 @@ private:
|
|||
|
||||
static Link<DisplayPopup> *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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue