From d8faf8ab08747f90a7b6b566927711f8e96c0c87 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Mon, 19 Sep 2022 13:08:27 +0300 Subject: [PATCH] Fix multi-screen drag-and-drop in WindowHeap DND was failing with the following error file:///data/projects/usr/lib/qml/org/kde/kwin/private/effects/WindowHeap.qml:96: TypeError: Cannot read property 'mapToGlobal' of undefined --- src/effects/private/qml/WindowHeap.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/effects/private/qml/WindowHeap.qml b/src/effects/private/qml/WindowHeap.qml index 2c59023976..242776e67f 100644 --- a/src/effects/private/qml/WindowHeap.qml +++ b/src/effects/private/qml/WindowHeap.qml @@ -93,9 +93,7 @@ FocusScope { for (let i in screens) { if (targetScreen === screens[i]) { found = true; - let globalPos = item.screen.mapToGlobal(item.mapToItem(null, 0,0)); - let heapRelativePos = targetScreen.mapFromGlobal(globalPos); - heapRelativePos = heap.mapFromItem(null, heapRelativePos.x, heapRelativePos.y); + const heapRelativePos = heap.mapFromGlobal(item.mapToGlobal(0, 0)); otherScreenThumbnail.cloneOf = item otherScreenThumbnail.x = heapRelativePos.x; otherScreenThumbnail.y = heapRelativePos.y;