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
This commit is contained in:
Vlad Zahorodnii 2022-09-19 13:08:27 +03:00
parent 6d9f740d6f
commit d8faf8ab08

View file

@ -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;