From 1df73874fc890aade062e84e89607c8391c6356c Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Thu, 3 Oct 2024 02:11:24 +0300 Subject: [PATCH] scene: Re-order item list integrity checks Amends 6738473f3d14addbf8ae01c5f0a2f2e27faae0c8. It's better to check whether Item::childItems() has the same items as Item::sortedChildItems() first because it gives more context about the integrity of the lists. If Item::sortedChildItems() is corrupted but Item::childItems() is fine, we may miss that important detail because "aliveWindowItems != sortedWindowItems" comes first. --- src/scene/workspacescene.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/scene/workspacescene.cpp b/src/scene/workspacescene.cpp index 44632b5fd6..1db2e96362 100644 --- a/src/scene/workspacescene.cpp +++ b/src/scene/workspacescene.cpp @@ -510,12 +510,12 @@ void WorkspaceScene::createStackingOrder() } std::sort(windowItems.begin(), windowItems.end()); - if (aliveWindowItems != sortedWindowItems) { - qFatal("workspaceWindowItems != sortedWindowItems"); - } if (sortedWindowItems != windowItems) { qFatal("sortedWindowItems != windowItems"); } + if (aliveWindowItems != sortedWindowItems) { + qFatal("workspaceWindowItems != sortedWindowItems"); + } } for (Item *item : std::as_const(items)) {