From 43fe97dc11191ed420fd435acd7ca24e975e69ed Mon Sep 17 00:00:00 2001 From: Marco Allegretti Date: Mon, 1 Jun 2026 15:20:53 +0200 Subject: [PATCH] Drop MobileShell motion dependency in KWin QML Replace MobileShell motion imports/animations with local Qt Quick ColorAnimation and NumberAnimation timings so decoration and snap-assist effects animate consistently without shell plugin coupling. --- .../org.shift.decoration/contents/ui/main.qml | 11 +++++------ kwin/effects/shift-snap-assist/contents/ui/main.qml | 5 ++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/kwin/decorations/org.shift.decoration/contents/ui/main.qml b/kwin/decorations/org.shift.decoration/contents/ui/main.qml index 392a9a61..0804dace 100644 --- a/kwin/decorations/org.shift.decoration/contents/ui/main.qml +++ b/kwin/decorations/org.shift.decoration/contents/ui/main.qml @@ -4,7 +4,6 @@ import QtQuick import QtQuick.Shapes import org.kde.kwin.decoration -import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings Decoration { @@ -24,7 +23,7 @@ Decoration { readonly property int normalCornerRadius: 8 readonly property int cornerRadius: decoration.client.maximized ? 0 : normalCornerRadius readonly property int frameThickness: decoration.client.maximized ? 0 : normalCornerRadius - readonly property int shortAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.EffectsFast) + readonly property int shortAnimationDuration: 120 readonly property bool windowMenuAllowed: !ShellSettings.Settings.convergenceModeEnabled || ShellSettings.Settings.gamingModeEnabled || !ShellSettings.Settings.dynamicTilingEnabled @@ -94,7 +93,7 @@ Decoration { height: root.barHeight radius: root.cornerRadius color: decoration.client.active ? root.activeBar : root.inactiveBar - Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } } + Behavior on color { ColorAnimation { duration: root.shortAnimationDuration; easing.type: Easing.OutCubic } } // Square off bottom half — only top corners are rounded Rectangle { @@ -135,7 +134,7 @@ Decoration { elide: Text.ElideMiddle horizontalAlignment: Text.AlignHCenter renderType: Text.NativeRendering - Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } } + Behavior on color { ColorAnimation { duration: root.shortAnimationDuration; easing.type: Easing.OutCubic } } } Row { @@ -243,7 +242,7 @@ Decoration { color: parent.pressed ? Qt.darker(parent.hoverColor, 1.3) : parent.hovered ? parent.hoverColor : parent.normalColor - Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } } + Behavior on color { ColorAnimation { duration: root.shortAnimationDuration; easing.type: Easing.OutCubic } } Text { anchors.centerIn: parent @@ -252,7 +251,7 @@ Decoration { font.pixelSize: Math.round(parent.width * 0.66) font.weight: Font.Bold opacity: 1.0 - Behavior on opacity { MobileShell.MotionNumberAnimation { type: MobileShell.Motion.EffectsFast; duration: root.shortAnimationDuration } } + Behavior on opacity { NumberAnimation { duration: root.shortAnimationDuration; easing.type: Easing.OutCubic } } } } } diff --git a/kwin/effects/shift-snap-assist/contents/ui/main.qml b/kwin/effects/shift-snap-assist/contents/ui/main.qml index 52024e5f..2241b26a 100644 --- a/kwin/effects/shift-snap-assist/contents/ui/main.qml +++ b/kwin/effects/shift-snap-assist/contents/ui/main.qml @@ -14,7 +14,6 @@ import QtQuick import QtQuick.Layouts import org.kde.kwin as KWinComponents -import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.shellsettingsplugin as ShellSettings KWinComponents.SceneEffect { @@ -39,7 +38,7 @@ KWinComponents.SceneEffect { readonly property int panelScreenMargin: 8 readonly property int panelCursorGap: 12 readonly property int panelCursorRightBias: 34 - readonly property int hoverAnimationDuration: MobileShell.Motion.duration(MobileShell.Motion.Press) + readonly property int hoverAnimationDuration: 100 property var hoverWindowId: null property int hoverTicks: 0 property string hoverWindowStateKey: "" @@ -651,7 +650,7 @@ KWinComponents.SceneEffect { property bool hovered: false - Behavior on color { MobileShell.MotionColorAnimation { type: MobileShell.Motion.Press; duration: effect.hoverAnimationDuration } } + Behavior on color { ColorAnimation { duration: effect.hoverAnimationDuration; easing.type: Easing.OutCubic } } Rectangle { id: previewFrame