Verified Commit 30de75a9 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

effects/private: Fix crash when shutting down desktop grid and overview

Because of const/non-const issues, iterator got invalidated in the loop,
which led to a crash.

Cases that trigger it: interaction with a thumbnail while the effect is
returning to initial state and shuts down. For example, slightly
dragging and releasing a thumbnail such that both TapHandler & DragHandler
would react and play each their own transition (yes, it's another bug);
or by pressing Escape key while dragging.

(cherry picked from commit d3a5a72a)
parent 3b0d4b14
......@@ -23,7 +23,7 @@ public:
return effect->d.get();
bool isItemOnScreen(QQuickItem *item, EffectScreen *screen);
bool isItemOnScreen(QQuickItem *item, EffectScreen *screen) const;
SharedQmlEngine::Ptr qmlEngine;
std::unique_ptr<QQmlComponent> qmlComponent;
......@@ -34,13 +34,13 @@ public:
std::unique_ptr<QWindow> dummyWindow;
bool QuickSceneEffectPrivate::isItemOnScreen(QQuickItem *item, EffectScreen *screen)
bool QuickSceneEffectPrivate::isItemOnScreen(QQuickItem *item, EffectScreen *screen) const
if (!item || !screen || !views.contains(screen)) {
return false;
auto *view = views[screen];
const QuickSceneView *view = views[screen];
auto *rootItem = view->rootItem();
auto candidate = item->parentItem();
// Is there a more efficient way?
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