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.
This commit is contained in:
outfoxxed 2024-07-27 02:28:21 -07:00
parent 4b2e569e94
commit 18563b1273
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -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<QWaylandWindow*>(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) {