Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 6b3e55d6 authored by Martin Flöser's avatar Martin Flöser

Implement isPopupWindow for internal windows

Summary:
Just accessing Qt::Popup WindowFlag.

BUG: 402852

Test Plan: Not tested for the described problematic case

Reviewers: #kwin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17981
parent bedd8582
......@@ -63,6 +63,7 @@ private Q_SLOTS:
void testSkipCloseAnimation();
void testModifierClickUnrestrictedMove();
void testModifierScroll();
void testPopup();
};
class HelperWindow : public QRasterWindow
......@@ -671,6 +672,21 @@ void InternalWindowTest::testModifierScroll()
kwinApp()->platform()->keyboardKeyReleased(KEY_LEFTALT, timestamp++);
}
void InternalWindowTest::testPopup()
{
QSignalSpy clientAddedSpy(waylandServer(), &WaylandServer::shellClientAdded);
QVERIFY(clientAddedSpy.isValid());
HelperWindow win;
win.setGeometry(0, 0, 100, 100);
win.setFlags(win.flags() | Qt::Popup);
win.show();
QVERIFY(clientAddedSpy.wait());
QCOMPARE(clientAddedSpy.count(), 1);
auto internalClient = clientAddedSpy.first().first().value<ShellClient*>();
QVERIFY(internalClient);
QCOMPARE(internalClient->isPopupWindow(), true);
}
}
WAYLANDTEST_MAIN(KWin::InternalWindowTest)
......
......@@ -1982,6 +1982,9 @@ bool ShellClient::isPopupWindow() const
if (Toplevel::isPopupWindow()) {
return true;
}
if (isInternal() && m_internalWindow) {
return m_internalWindow->flags().testFlag(Qt::Popup);
}
if (m_shellSurface != nullptr) {
return m_shellSurface->isPopup();
}
......
Markdown is supported
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