Simplify transient initialization in Deleted

Summary:
AbstractClient::mainClients is quite generic, it can return either
transientFor parent or group member parents.

Test Plan: Existing tests still pass.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: davidedmundson, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D16586
This commit is contained in:
Vlad Zagorodniy 2018-11-01 13:10:48 +02:00
parent 892851fff3
commit 6a36c35d73

View file

@ -125,6 +125,7 @@ void Deleted::copyToDeleted(Toplevel* c)
m_modal = client->isModal();
m_mainClients = client->mainClients();
foreach (AbstractClient *c, m_mainClients) {
addTransientFor(c);
connect(c, &AbstractClient::windowClosed, this, &Deleted::mainClientClosed);
}
m_fullscreen = client->isFullScreen();
@ -137,20 +138,6 @@ void Deleted::copyToDeleted(Toplevel* c)
const auto *x11Client = qobject_cast<Client *>(client);
m_wasGroupTransient = x11Client && x11Client->groupTransient();
if (m_wasGroupTransient) {
const auto members = x11Client->group()->members();
for (Client *member : members) {
if (member != client) {
addTransientFor(member);
}
}
} else {
AbstractClient *transientFor = client->transientFor();
if (transientFor != nullptr) {
addTransientFor(transientFor);
}
}
}
m_wasWaylandClient = qobject_cast<ShellClient *>(c) != nullptr;