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
This commit is contained in:
parent
bedd85821f
commit
6b3e55d6f5
2 changed files with 19 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue