diff --git a/src/core/popupanchor.cpp b/src/core/popupanchor.cpp index aa570b3..2b5b1ba 100644 --- a/src/core/popupanchor.cpp +++ b/src/core/popupanchor.cpp @@ -147,12 +147,12 @@ void PopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bool only auto parentGeometry = parentWindow->geometry(); auto windowGeometry = window->geometry(); + emit anchor->anchoring(); anchor->updatePlacement(parentGeometry.topLeft(), windowGeometry.size()); + if (onlyIfDirty && !anchor->isDirty()) return; anchor->markClean(); - emit anchor->anchoring(); - auto adjustment = anchor->adjustment(); auto screenGeometry = parentWindow->screen()->geometry(); auto anchorRectGeometry = anchor->rect().qrect().translated(parentGeometry.topLeft()); diff --git a/src/wayland/popupanchor.cpp b/src/wayland/popupanchor.cpp index c6a6412..ca90dc1 100644 --- a/src/wayland/popupanchor.cpp +++ b/src/wayland/popupanchor.cpp @@ -21,6 +21,8 @@ void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bo auto* waylandWindow = dynamic_cast(window->handle()); auto* popupRole = waylandWindow ? waylandWindow->surfaceRole<::xdg_popup>() : nullptr; + emit anchor->anchoring(); + // If a popup becomes invisble after creation ensure the _q properties will // be set and not ignored because the rest is the same. anchor->updatePlacement({popupRole != nullptr, 0}, {}); @@ -42,8 +44,6 @@ void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bo positioner.set_constraint_adjustment(anchor->adjustment().toInt()); - emit anchor->anchoring(); - auto anchorRect = anchor->rect(); if (auto* p = window->transientParent()) {