From dcd9ee157eb5db525686c4f5ba100ebbd1e3be8f Mon Sep 17 00:00:00 2001 From: Wu JiangYu Date: Tue, 24 Nov 2026 14:44:58 +0800 Subject: [PATCH] fix(dock): correct window size and radius during animations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Relax window minimum size to 1 unless dragging so the dock can shrink while hiding. 2. Allow minimum width to shrink when fashion dock mode is enabled. 3. Reset window radius to 0 on xcb during hide/show animations to avoid KWin whole-window blur. 4. Enable transform-based animation on xcb regardless of fashion dock mode. Log: Fix dock window size and radius handling during hide/show animations Influence: Smoother dock animations without blur artifacts on xcb fix(dock): 修复动画过程中窗口尺寸与圆角处理 1. 窗口最小尺寸在非拖拽时放宽为 1,使停靠栏隐藏时可收缩。 2. 时尚模式启用时允许最小宽度收缩。 3. xcb 下隐藏/显示动画期间将窗口圆角重置为 0,避免 KWin 整窗模糊。 4. xcb 下无论是否开启时尚模式都启用基于变换的动画。 Log: 修复停靠栏隐藏/显示动画期间的窗口尺寸与圆角处理 Influence: xcb 下停靠栏动画更流畅且无模糊残影 PMS: TASK-384075 (cherry picked from commit 1959365d688bea89529ea3efc742458bd9577969) --- panels/dock/package/main.qml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/panels/dock/package/main.qml b/panels/dock/package/main.qml index 1bf055850..04efac073 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -116,9 +116,10 @@ Window { color: "transparent" flags: Qt.WindowDoesNotAcceptFocus maximumHeight: useColumnLayout ? Screen.height : Dock.MAX_DOCK_SIZE - minimumHeight: useColumnLayout? Screen.height : Dock.MIN_DOCK_SIZE + minimumHeight: useColumnLayout ? Screen.height : (isDragging ? Dock.MIN_DOCK_SIZE : 1) maximumWidth: useColumnLayout ? Dock.MAX_DOCK_SIZE : Screen.width - minimumWidth: useColumnLayout ? Dock.MIN_DOCK_SIZE : Screen.width + minimumWidth: useColumnLayout ? (isDragging ? Dock.MIN_DOCK_SIZE : 1) + : (fashionDock.enabled ? 1 : Screen.width) function blendColorAlpha(fallback) { var appearance = DS.applet("org.deepin.ds.dde-appearance") @@ -156,7 +157,20 @@ Window { DLayerShellWindow.keyboardInteractivity: DLayerShellWindow.KeyboardInteractivityNone D.DWindow.enabled: true - D.DWindow.windowRadius: fashionDock.enabled ? fashionDock.backgroundRadius : 0 + D.DWindow.windowRadius: { + if (!fashionDock.enabled) + return 0 + + // KWin can turn a rounded window's local blur region into whole-window + // blur. Restore the native radius only after the content is back in place; + // StyledBehindWindowBlur keeps its own rounded corners during animation. + if (Qt.platform.pluginName === "xcb" + && (hideShowAnimation.running || dockAnimation.running + || dockTransform.x !== 0 || dockTransform.y !== 0)) + return 0 + + return fashionDock.backgroundRadius + } //TODO:由于windoweffect处理有BUG,导致动画结束后一致保持无阴影,无borderwidth状态。 无法恢复到最初的阴影和边框 //D.DWindow.windowEffect: hideShowAnimation.running ? D.PlatformHandle.EffectNoShadow | D.PlatformHandle.EffectNoBorder : 0 @@ -198,7 +212,7 @@ Window { PropertyAnimation { id: hideShowAnimation; // Currently, Wayland (Treeland) doesn't support StyledBehindWindowBlur inside the window, thus we keep using the window size approach on Wayland - property bool useTransformBasedAnimation: Qt.platform.pluginName === "xcb" && !fashionDock.enabled + property bool useTransformBasedAnimation: Qt.platform.pluginName === "xcb" property bool hiding: false target: useTransformBasedAnimation ? dockTransform : dock; property: {