Skip to content

Commit

Permalink
core/popupanchor: emit anchoring() before checking anchor props
Browse files Browse the repository at this point in the history
  • Loading branch information
outfoxxed committed Nov 24, 2024
1 parent 6f99933 commit e3d003e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/popupanchor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/wayland/popupanchor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bo
auto* waylandWindow = dynamic_cast<QWaylandWindow*>(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}, {});
Expand All @@ -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()) {
Expand Down

0 comments on commit e3d003e

Please sign in to comment.