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 7a28e0fe authored by Vlad Zahorodnii's avatar Vlad Zahorodnii

[wayland] Minimize transients together with parent

Summary:
If a parent window is minimized, then its transients have to be
minimized as well, so the minimize behavior is the same on both
X11 and Wayland.

BUG: 401950
FIXED-IN: 5.15.0

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D17570
parent e86d8461
......@@ -94,6 +94,8 @@ private Q_SLOTS:
void testNoDecorationModeRequested();
void testSendClientWithTransientToDesktop_data();
void testSendClientWithTransientToDesktop();
void testMinimizeWindowWithTransients_data();
void testMinimizeWindowWithTransients();
};
void TestShellClient::initTestCase()
......@@ -1145,5 +1147,50 @@ void TestShellClient::testSendClientWithTransientToDesktop()
QCOMPARE(transient->desktop(), 1);
}
void TestShellClient::testMinimizeWindowWithTransients_data()
{
QTest::addColumn<Test::ShellSurfaceType>("type");
QTest::newRow("xdgShellV5") << Test::ShellSurfaceType::XdgShellV5;
QTest::newRow("xdgShellV6") << Test::ShellSurfaceType::XdgShellV6;
QTest::newRow("xdgWmBase") << Test::ShellSurfaceType::XdgShellStable;
}
void TestShellClient::testMinimizeWindowWithTransients()
{
// this test verifies that when minimizing/unminimizing a window all its
// transients will be minimized/unminimized as well
// create the main window
QScopedPointer<Surface> surface(Test::createSurface());
QFETCH(Test::ShellSurfaceType, type);
QScopedPointer<XdgShellSurface> shellSurface(qobject_cast<XdgShellSurface *>(
Test::createShellSurface(type, surface.data())));
auto c = Test::renderAndWaitForShown(surface.data(), QSize(100, 50), Qt::blue);
QVERIFY(c);
QVERIFY(!c->isMinimized());
// create a transient window
QScopedPointer<Surface> transientSurface(Test::createSurface());
QScopedPointer<XdgShellSurface> transientShellSurface(qobject_cast<XdgShellSurface *>(
Test::createShellSurface(type, transientSurface.data())));
transientShellSurface->setTransientFor(shellSurface.data());
auto transient = Test::renderAndWaitForShown(transientSurface.data(), QSize(100, 50), Qt::red);
QVERIFY(transient);
QVERIFY(!transient->isMinimized());
QCOMPARE(transient->transientFor(), c);
QVERIFY(c->hasTransient(transient, false));
// minimize the main window, the transient should be minimized as well
c->minimize();
QVERIFY(c->isMinimized());
QVERIFY(transient->isMinimized());
// unminimize the main window, the transient should be unminimized as well
c->unminimize();
QVERIFY(!c->isMinimized());
QVERIFY(!transient->isMinimized());
}
WAYLANDTEST_MAIN(TestShellClient)
#include "shell_client_test.moc"
......@@ -1850,6 +1850,7 @@ void ShellClient::doMinimize()
} else {
emit windowShown(this);
}
workspace()->updateMinimizedOfTransients(this);
}
bool ShellClient::setupCompositing()
......
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