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

Generalize constrainedStackingOrder for group transients and ordinary transients

Summary:
We don't really have to have two different code paths for group
transients and ordinary transients. For now, AbstractClient::hasTransient
is good enough to check the relationship between potential parent and
the transient.

In long term, we need to "invert" the relationship, instead of checking
whether given parent window has a transient, we should check whether
given transient is a transient for a given window so we can keep Deleted
transients above their old parents.

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D15893
parent 597445e2
......@@ -73,6 +73,7 @@ if (XCB_ICCCM_FOUND)
integrationTest(NAME testGlobalShortcuts SRCS globalshortcuts_test.cpp LIBS XCB::ICCCM)
integrationTest(NAME testSceneQPainter SRCS scene_qpainter_test.cpp LIBS XCB::ICCCM)
integrationTest(NAME testSceneQPainterShadow SRCS scene_qpainter_shadow_test.cpp LIBS XCB::ICCCM)
integrationTest(NAME testStackingOrder SRCS stacking_order_test.cpp LIBS XCB::ICCCM)
if (KWIN_BUILD_ACTIVITIES)
integrationTest(NAME testActivities SRCS activities_test.cpp LIBS XCB::ICCCM)
......
This diff is collapsed.
......@@ -534,41 +534,19 @@ ToplevelList Workspace::constrainedStackingOrder()
continue;
}
int i2 = -1;
Client *ccurrent = qobject_cast<Client*>(current);
if (ccurrent && ccurrent->groupTransient()) {
if (ccurrent->group()->members().count() > 0) {
// find topmost client this one is transient for
for (i2 = stacking.size() - 1;
i2 >= 0;
--i2) {
if (stacking[ i2 ] == stacking[ i ]) {
i2 = -1; // don't reorder, already the topmost in the group
break;
}
AbstractClient *c2 = qobject_cast<AbstractClient*>(stacking[ i2 ]);
if (!c2) {
continue;
}
if (c2->hasTransient(current, true)
&& keepTransientAbove(c2, current))
break;
}
} // else i2 remains pointing at -1
} else {
for (i2 = stacking.size() - 1;
i2 >= 0;
--i2) {
AbstractClient *c2 = qobject_cast<AbstractClient*>(stacking[ i2 ]);
if (!c2) {
continue;
}
if (c2 == current) {
i2 = -1; // don't reorder, already on top of its mainwindow
break;
}
if (c2 == current->transientFor()
&& keepTransientAbove(c2, current))
break;
// find topmost client this one is transient for
for (i2 = stacking.size() - 1; i2 >= 0; --i2) {
AbstractClient *c2 = qobject_cast<AbstractClient *>(stacking[i2]);
if (!c2) {
continue;
}
if (c2 == current) {
i2 = -1; // Don't reorder, already on top of its main window.
break;
}
if (c2->hasTransient(current, true)
&& keepTransientAbove(c2, current)) {
break;
}
}
if (i2 == -1) {
......
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