From 00ba4aedccd6cc32ca11b94aea4ab26be7e8c438 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Mon, 18 Jul 2022 23:11:27 +0100 Subject: [PATCH] Make DesktopView a FocusScope --- src/effects/desktopgrid/qml/DesktopView.qml | 27 ++++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/effects/desktopgrid/qml/DesktopView.qml b/src/effects/desktopgrid/qml/DesktopView.qml index ef4227d26d..7c41238344 100644 --- a/src/effects/desktopgrid/qml/DesktopView.qml +++ b/src/effects/desktopgrid/qml/DesktopView.qml @@ -12,26 +12,29 @@ import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PC3 import org.kde.kwin.private.desktopgrid 1.0 - -DropArea { +FocusScope { id: desktopView required property QtObject clientModel required property QtObject desktop readonly property bool dragActive: heap.dragActive || dragHandler.active || xAnim.running || yAnim.running property real panelOpacity: 1 + focus: true - onEntered: { - drag.accepted = true; - } - onDropped: { - if (drag.source instanceof DropArea) { - if (desktopView === drag.source) { - return; + DropArea { + anchors.fill: parent + onEntered: { + drag.accepted = true; + } + onDropped: { + if (drag.source instanceof DropArea) { + if (desktopView === drag.source) { + return; + } + effect.swapDesktops(drag.source.desktop.x11DesktopNumber, desktop.x11DesktopNumber); + } else { + drag.source.desktop = desktopView.desktop.x11DesktopNumber; } - effect.swapDesktops(drag.source.desktop.x11DesktopNumber, desktop.x11DesktopNumber); - } else { - drag.source.desktop = desktopView.desktop.x11DesktopNumber; } } Connections {