effects/overview: Animate if the thumbnail is dropped in an heap

If the new position the thumbnail was dropped intersects the geometry of
an heap in any way, then execute the animation, otherwise skip it
(the case of drop on a desktop thumbnails in the overview)
previous patch attempted that but with not completely correct logic

BUG:496646
wilder/Plasma/6.3
Marco Martin 1 year ago
parent 592f6c5820
commit 0e9f1e721c
  1. 6
      src/plugins/private/qml/WindowHeapDelegate.qml

@ -162,10 +162,8 @@ ExpoCell {
returnAnimation.restart();
// If we dropped on another desktop, don't make the window fly off the screen
if (oldGlobalRect.x < heapRect.x ||
oldGlobalRect.y < heapRect.y ||
heapRect.x + heapRect.width < oldGlobalRect.x + oldGlobalRect.width ||
heapRect.y + heapRect.height < oldGlobalRect.y + oldGlobalRect.height) {
if ((oldGlobalRect.x < heapRect.x && heapRect.x + heapRect.width < oldGlobalRect.x + oldGlobalRect.width) ||
(oldGlobalRect.y < heapRect.y && heapRect.y + heapRect.height < oldGlobalRect.y + oldGlobalRect.height)) {
returnAnimation.complete();
}
}

Loading…
Cancel
Save