Skip to content

Commit e3d003e

Browse files
committed
core/popupanchor: emit anchoring() before checking anchor props
1 parent 6f99933 commit e3d003e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/popupanchor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,12 @@ void PopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bool only
147147
auto parentGeometry = parentWindow->geometry();
148148
auto windowGeometry = window->geometry();
149149

150+
emit anchor->anchoring();
150151
anchor->updatePlacement(parentGeometry.topLeft(), windowGeometry.size());
152+
151153
if (onlyIfDirty && !anchor->isDirty()) return;
152154
anchor->markClean();
153155

154-
emit anchor->anchoring();
155-
156156
auto adjustment = anchor->adjustment();
157157
auto screenGeometry = parentWindow->screen()->geometry();
158158
auto anchorRectGeometry = anchor->rect().qrect().translated(parentGeometry.topLeft());

src/wayland/popupanchor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bo
2121
auto* waylandWindow = dynamic_cast<QWaylandWindow*>(window->handle());
2222
auto* popupRole = waylandWindow ? waylandWindow->surfaceRole<::xdg_popup>() : nullptr;
2323

24+
emit anchor->anchoring();
25+
2426
// If a popup becomes invisble after creation ensure the _q properties will
2527
// be set and not ignored because the rest is the same.
2628
anchor->updatePlacement({popupRole != nullptr, 0}, {});
@@ -42,8 +44,6 @@ void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bo
4244

4345
positioner.set_constraint_adjustment(anchor->adjustment().toInt());
4446

45-
emit anchor->anchoring();
46-
4747
auto anchorRect = anchor->rect();
4848

4949
if (auto* p = window->transientParent()) {

0 commit comments

Comments
 (0)