From 2e0b33eae4588a829e64495efbb27a25da311190 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Thu, 7 Nov 2024 15:40:02 +0100 Subject: [PATCH] effects/overview: Don't make thumbnails fly off the screen When dropping a thumbnail on another desktop, don't animate the position, otherwise we see the window oddly flying off the screen to go on its new position on the different desktop BUG:495444 --- src/plugins/private/qml/WindowHeapDelegate.qml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/plugins/private/qml/WindowHeapDelegate.qml b/src/plugins/private/qml/WindowHeapDelegate.qml index 45ed597552..a92ac7a7c7 100644 --- a/src/plugins/private/qml/WindowHeapDelegate.qml +++ b/src/plugins/private/qml/WindowHeapDelegate.qml @@ -155,7 +155,16 @@ ExpoCell { y = newGlobalRect.y; width = newGlobalRect.width; height = newGlobalRect.height; + returnAnimation.restart(); + + // If we dropped on another desktop, don't make the window fly off the screen + if (newGlobalRect.x < thumb.windowHeap.x || + newGlobalRect.y < thumb.windowHeap.y || + thumb.windowHeap.x + thumb.windowHeap.width < newGlobalRect.x + newGlobalRect.width || + thumb.windowHeap.y + thumb.windowHeap.height < newGlobalRect.y + newGlobalRect.height) { + returnAnimation.complete(); + } } function deleteDND() { thumb.windowHeap.deleteDND(thumb.window.internalId);