Commit 230b560f authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

autotests: Fix TestXdgShellClient

parent 21eee7de
......@@ -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()
......
......@@ -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);
......
......@@ -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;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment