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
wilder/Plasma/6.3
Marco Martin 1 year ago
parent 002567476d
commit 2e0b33eae4
  1. 9
      src/plugins/private/qml/WindowHeapDelegate.qml

@ -155,7 +155,16 @@ ExpoCell {
y = newGlobalRect.y; y = newGlobalRect.y;
width = newGlobalRect.width; width = newGlobalRect.width;
height = newGlobalRect.height; height = newGlobalRect.height;
returnAnimation.restart(); 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() { function deleteDND() {
thumb.windowHeap.deleteDND(thumb.window.internalId); thumb.windowHeap.deleteDND(thumb.window.internalId);

Loading…
Cancel
Save