effects/desktopgrid: Fix dragging and swapping desktops on a grid

Amends 00ba4aedcc.
This commit is contained in:
ivan tkachenko 2022-07-27 02:45:31 +03:00
parent f1a45b6509
commit 074fed313b
No known key found for this signature in database
GPG key ID: AF72731B7C654CB3

View file

@ -31,12 +31,14 @@ FocusScope {
drag.accepted = true; drag.accepted = true;
} }
onDropped: { onDropped: {
if (drag.source instanceof DropArea) { if (drag.source instanceof DesktopView) {
// dragging a desktop as a whole
if (desktopView === drag.source) { if (desktopView === drag.source) {
return; return;
} }
effect.swapDesktops(drag.source.desktop.x11DesktopNumber, desktop.x11DesktopNumber); effect.swapDesktops(drag.source.desktop.x11DesktopNumber, desktop.x11DesktopNumber);
} else { } else {
// dragging a KWin::Window
drag.source.desktop = desktopView.desktop.x11DesktopNumber; drag.source.desktop = desktopView.desktop.x11DesktopNumber;
} }
} }