core/popupanchor: emit anchoring() before checking anchor props

This commit is contained in:
outfoxxed 2024-11-24 13:22:10 -08:00
parent 6f9993394a
commit e3d003e7ab
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 4 additions and 4 deletions

View file

@ -147,12 +147,12 @@ void PopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bool only
auto parentGeometry = parentWindow->geometry(); auto parentGeometry = parentWindow->geometry();
auto windowGeometry = window->geometry(); auto windowGeometry = window->geometry();
emit anchor->anchoring();
anchor->updatePlacement(parentGeometry.topLeft(), windowGeometry.size()); anchor->updatePlacement(parentGeometry.topLeft(), windowGeometry.size());
if (onlyIfDirty && !anchor->isDirty()) return; if (onlyIfDirty && !anchor->isDirty()) return;
anchor->markClean(); anchor->markClean();
emit anchor->anchoring();
auto adjustment = anchor->adjustment(); auto adjustment = anchor->adjustment();
auto screenGeometry = parentWindow->screen()->geometry(); auto screenGeometry = parentWindow->screen()->geometry();
auto anchorRectGeometry = anchor->rect().qrect().translated(parentGeometry.topLeft()); auto anchorRectGeometry = anchor->rect().qrect().translated(parentGeometry.topLeft());

View file

@ -21,6 +21,8 @@ void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bo
auto* waylandWindow = dynamic_cast<QWaylandWindow*>(window->handle()); auto* waylandWindow = dynamic_cast<QWaylandWindow*>(window->handle());
auto* popupRole = waylandWindow ? waylandWindow->surfaceRole<::xdg_popup>() : nullptr; auto* popupRole = waylandWindow ? waylandWindow->surfaceRole<::xdg_popup>() : nullptr;
emit anchor->anchoring();
// If a popup becomes invisble after creation ensure the _q properties will // If a popup becomes invisble after creation ensure the _q properties will
// be set and not ignored because the rest is the same. // be set and not ignored because the rest is the same.
anchor->updatePlacement({popupRole != nullptr, 0}, {}); anchor->updatePlacement({popupRole != nullptr, 0}, {});
@ -42,8 +44,6 @@ void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bo
positioner.set_constraint_adjustment(anchor->adjustment().toInt()); positioner.set_constraint_adjustment(anchor->adjustment().toInt());
emit anchor->anchoring();
auto anchorRect = anchor->rect(); auto anchorRect = anchor->rect();
if (auto* p = window->transientParent()) { if (auto* p = window->transientParent()) {