mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Fixed topmost window vs prompt problem
git-svn-id: svn://ultimatepp.org/upp/trunk@585 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5978a9f87a
commit
caf32ef3b8
3 changed files with 10 additions and 4 deletions
|
|
@ -246,9 +246,8 @@ TopWindow& TopWindow::TopMost(bool b, bool stay_top)
|
|||
{
|
||||
HWND hwnd;
|
||||
if(hwnd = GetHWND())
|
||||
{
|
||||
SetWindowPos(hwnd, b ? HWND_TOPMOST : (stay_top ? HWND_NOTOPMOST : HWND_BOTTOM),0,0,0,0,SWP_NOMOVE|SWP_NOSIZE );
|
||||
}
|
||||
SetWindowPos(hwnd, b ? HWND_TOPMOST : (stay_top ? HWND_NOTOPMOST : HWND_BOTTOM),
|
||||
0,0,0,0,SWP_NOMOVE|SWP_NOSIZE );
|
||||
return ExStyle(b ? GetExStyle() | WS_EX_TOPMOST : GetExStyle() & ~WS_EX_TOPMOST);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -276,7 +276,6 @@ void TopWindow::Maximize(bool effect)
|
|||
void TopWindow::Overlap(bool effect)
|
||||
{
|
||||
state = OVERLAPPED;
|
||||
|
||||
}
|
||||
|
||||
TopWindow& TopWindow::TopMost(bool b, bool)
|
||||
|
|
|
|||
|
|
@ -107,6 +107,14 @@ int Prompt(Callback1<const String&> WhenLink,
|
|||
}
|
||||
dlg.WhenClose = dlg.Breaker(button3 ? -1 : 0);
|
||||
dlg.Open();
|
||||
Vector<Ctrl *> wins = Ctrl::GetTopWindows();
|
||||
for(int i = 0; i < wins.GetCount(); i++) {
|
||||
TopWindow *w = dynamic_cast<TopWindow *>(wins[i]);
|
||||
if(w->GetScreenRect().Intersects(dlg.GetScreenRect()) && w->IsTopMost()) {
|
||||
dlg.TopMost();
|
||||
break;
|
||||
}
|
||||
}
|
||||
dlg.Title(title);
|
||||
return dlg.RunAppModal();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue