Commit 106fb66c authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Make Scene::createStackingOrder() more efficient

Currently, there's a separate pass to filter out windows not ready for
compositing or windows that must be invisible. That has two issues: we
could merge that pass with the pass that populates stacking_order and
"windows" can detach.
parent 066ac320
Pipeline #169775 passed with stage
in 24 minutes and 28 seconds
......@@ -571,19 +571,15 @@ void Scene::createStackingOrder()
// TODO? This cannot be used so carelessly - needs protections against broken clients, the
// window should not get focus before it's displayed, handle unredirected windows properly and
// so on.
for (Window *win : windows) {
if (!win->readyForPainting()) {
windows.removeAll(win);
for (Window *window : std::as_const(windows)) {
if (!window->readyForPainting()) {
continue;
}
if (!m_filter.filterAcceptsWindow(win)) {
windows.removeAll(win);
if (!m_filter.filterAcceptsWindow(window)) {
continue;
}
}
// TODO: cache the stacking_order in case it has not changed
for (Window *c : std::as_const(windows)) {
Q_ASSERT(c->sceneWindow());
stacking_order.append(c->sceneWindow());
Q_ASSERT(window->sceneWindow());
stacking_order.append(window->sceneWindow());
}
}
......
Supports Markdown
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