From 230b560ffca1c85fa8bf27db4f4683eee877f7d1 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 1 Feb 2021 09:59:02 +0200 Subject: [PATCH] autotests: Fix TestXdgShellClient --- autotests/integration/xdgshellclient_test.cpp | 8 ++++---- xdgshellclient.cpp | 6 ++++-- xdgshellclient.h | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/autotests/integration/xdgshellclient_test.cpp b/autotests/integration/xdgshellclient_test.cpp index 3f8e17d663..02638c292b 100644 --- a/autotests/integration/xdgshellclient_test.cpp +++ b/autotests/integration/xdgshellclient_test.cpp @@ -125,13 +125,13 @@ void TestXdgShellClient::testXdgWindowReactive() QVERIFY(rootClient); QVERIFY(childClient); - QSignalSpy frameGeometryChangedSpy(childClient, &AbstractClient::frameGeometryChanged); - QVERIFY(frameGeometryChangedSpy.isValid()); + QSignalSpy popupConfigureRequested(popup.data(), &Test::XdgPopup::configureRequested); + QVERIFY(popupConfigureRequested.isValid()); rootClient->move(rootClient->x()+20, rootClient->y()+20); - QVERIFY(frameGeometryChangedSpy.wait()); - QCOMPARE(frameGeometryChangedSpy.count(), 1); + QVERIFY(popupConfigureRequested.wait()); + QCOMPARE(popupConfigureRequested.count(), 1); } void TestXdgShellClient::testXdgWindowRepositioning() diff --git a/xdgshellclient.cpp b/xdgshellclient.cpp index b6776ec8de..36e71e5204 100644 --- a/xdgshellclient.cpp +++ b/xdgshellclient.cpp @@ -1707,7 +1707,7 @@ XdgPopupClient::XdgPopupClient(XdgPopupInterface *shellSurface) this, &XdgPopupClient::destroyClient); } -void XdgPopupClient::handlePositionerBindings() +void XdgPopupClient::updateReactive() { if (m_shellSurface->positioner().isReactive()) { connect(transientFor(), &AbstractClient::frameGeometryChanged, @@ -1720,7 +1720,7 @@ void XdgPopupClient::handlePositionerBindings() void XdgPopupClient::handleRepositionRequested(quint32 token) { - handlePositionerBindings(); + updateReactive(); m_shellSurface->sendRepositioned(token); relayout(); } @@ -2012,6 +2012,8 @@ void XdgPopupClient::initialize() parentClient->addTransient(this); setTransientFor(parentClient); + updateReactive(); + blockGeometryUpdates(true); const QRect area = workspace()->clientArea(PlacementArea, Screens::self()->current(), desktop()); placeIn(area); diff --git a/xdgshellclient.h b/xdgshellclient.h index afe734a8c6..7d783fdf6a 100644 --- a/xdgshellclient.h +++ b/xdgshellclient.h @@ -248,10 +248,10 @@ protected: private: void handleGrabRequested(KWaylandServer::SeatInterface *seat, quint32 serial); - void handlePositionerBindings(); void handleRepositionRequested(quint32 token); void initialize(); void relayout(); + void updateReactive(); KWaylandServer::XdgPopupInterface *m_shellSurface; bool m_haveExplicitGrab = false;