mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-17 06:06:00 -06:00
okrokpokrok - WndSetPos fixed for popups
This commit is contained in:
parent
51df22c833
commit
6c076f6d9f
3 changed files with 11 additions and 5 deletions
|
|
@ -175,9 +175,7 @@ Rect Ctrl::GetWndScreenRect() const
|
|||
return Null;
|
||||
|
||||
|
||||
DTIMING("GetWndScreenRect");
|
||||
|
||||
if(utop->sync_rect) {
|
||||
if(utop->sync_rect || 1) { _DBG_
|
||||
|
||||
gint x, y;
|
||||
gint width, height;
|
||||
|
|
@ -512,6 +510,7 @@ bool Ctrl::SweepConfigure(bool wait)
|
|||
Rect rect = e.value;
|
||||
DLOG("SweepConfigure " << rect);
|
||||
DDUMP(GetWndScreenRect());
|
||||
DDUMP(rect);
|
||||
if(GetRect() != rect)
|
||||
SetWndRect(rect);
|
||||
r = true;
|
||||
|
|
@ -537,7 +536,8 @@ void Ctrl::WndSetPos(const Rect& rect)
|
|||
return;
|
||||
|
||||
SetWndRect(rect);
|
||||
if(TopWindow *tw = dynamic_cast<TopWindow *>(this))
|
||||
TopWindow *tw = dynamic_cast<TopWindow *>(this);
|
||||
if(tw)
|
||||
tw->SyncSizeHints();
|
||||
if(top && utop->csd) {
|
||||
Rect m = CSDMargins();
|
||||
|
|
@ -546,10 +546,13 @@ void Ctrl::WndSetPos(const Rect& rect)
|
|||
LSCH(rect.GetHeight()) + m.top + m.bottom);
|
||||
}
|
||||
else {
|
||||
Rect m = GetFrameMargins();
|
||||
Rect m(0, 0, 0, 0);
|
||||
if(tw)
|
||||
m = GetFrameMargins();
|
||||
gdk_window_move_resize(gdk(), LSC(rect.left - m.left), LSC(rect.top - m.top),
|
||||
LSCH(rect.GetWidth()), LSCH(rect.GetHeight()));
|
||||
}
|
||||
utop->sync_rect = true;
|
||||
LLOG("-- WndSetPos0 " << rect);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ void Animate(Ctrl& c, const Rect& target, int type)
|
|||
}
|
||||
c.SetRect(target);
|
||||
c.SetAlpha(255);
|
||||
DDUMP(target);
|
||||
}
|
||||
|
||||
void Animate(Ctrl& c, int x, int y, int cx, int cy, int type)
|
||||
|
|
|
|||
|
|
@ -595,10 +595,12 @@ void MenuBar::PopUp(Ctrl *owner, Point p, Size rsz)
|
|||
CloseHandle(CreateThread(NULL, 0, PlaySoundThread, NULL, 0, &dummy));
|
||||
#endif
|
||||
doeffect = true;
|
||||
DLOG("===================== MENU POPUP");
|
||||
Ctrl::PopUp(owner, true, true, GUI_DropShadows(), !owner);
|
||||
GuiPlatformAfterMenuPopUp();
|
||||
if(eff)
|
||||
Animate(*this, p.x, p.y, sz.cx, sz.cy);
|
||||
DDUMP(GetScreenRect());
|
||||
sz = GetSize(); // final size can be a bit bigger, e.g. in macos
|
||||
pane.RightPos(0, sz.cx).BottomPos(0, sz.cy);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue