Commit 8cfa3080 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Aleix Pol Gonzalez
Browse files

Fix InternalWindowTest::testDismissPopup

We were expecting a tooltip to be closed when clicking its
transientParent, but it's explicitly not something we are after. We
close popups when we click either other clients or the actual client on
the decoration.

This change makes it so we end up clicking another window instead of the
parent one that is unrelated.
parent 9577423d
......@@ -837,11 +837,18 @@ void InternalWindowTest::testDismissPopup()
auto serverPopup = clientAddedSpy.last().first().value<InternalClient *>();
QVERIFY(serverPopup);
//Create the other window to click
HelperWindow otherClientToplevel;
otherClientToplevel.setGeometry(100, 100, 100, 100);
otherClientToplevel.show();
QTRY_COMPARE(clientAddedSpy.count(), 3);
auto serverOtherToplevel = clientAddedSpy.last().first().value<InternalClient *>();
QVERIFY(serverOtherToplevel);
// Click somewhere outside the popup window.
QSignalSpy popupClosedSpy(serverPopup, &InternalClient::windowClosed);
quint32 timestamp = 0;
kwinApp()->platform()->pointerMotion(QPointF(serverPopup->x() + serverPopup->width() + 1,
serverPopup->y() + serverPopup->height() + 1),
kwinApp()->platform()->pointerMotion(serverOtherToplevel->frameGeometry().center(),
timestamp++);
kwinApp()->platform()->pointerButtonPressed(BTN_LEFT, timestamp++);
QTRY_COMPARE(popupClosedSpy.count(), 1);
......
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