autotests: Fix TestXdgShellClient

This commit is contained in:
Vlad Zahorodnii 2021-02-01 09:59:02 +02:00
parent 21eee7de18
commit 230b560ffc
3 changed files with 9 additions and 7 deletions

View file

@ -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()

View file

@ -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);

View file

@ -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;