From 18563b1273166f6e5795e892642fd11f6b66e69a Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sat, 27 Jul 2024 02:28:21 -0700 Subject: [PATCH] wayland/popupanchor: fix anchor state breaking show after reposition If the popup was hidden and reposition was called to update qt's initial positioning properties it would be cancelled by the dirty marker being unset. This includes if the popup is shown or not into its dirty state. --- src/wayland/popupanchor.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wayland/popupanchor.cpp b/src/wayland/popupanchor.cpp index bf6f9850..ec6e5dbe 100644 --- a/src/wayland/popupanchor.cpp +++ b/src/wayland/popupanchor.cpp @@ -15,11 +15,15 @@ using XdgPositioner = QtWayland::xdg_positioner; using qs::wayland::xdg_shell::XdgWmBase; void WaylandPopupPositioner::reposition(PopupAnchor* anchor, QWindow* window, bool onlyIfDirty) { - if (onlyIfDirty && !anchor->isDirty()) return; auto* waylandWindow = dynamic_cast(window->handle()); auto* popupRole = waylandWindow ? waylandWindow->surfaceRole<::xdg_popup>() : nullptr; + // 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}, {}); + + if (onlyIfDirty && !anchor->isDirty()) return; anchor->markClean(); if (popupRole) {