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


(cherry picked from commit 2e0b33eae4)

2e0b33ea effects/overview: Don't make thumbnails fly off the screen

Co-authored-by: Marco Martin <notmart@gmail.com>
wilder/Plasma/6.2
Marco Martin 1 year ago
parent faf476225b
commit 48b965b5c6
  1. 9
      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);

Loading…
Cancel
Save