From 8505854b3ef6e9a4b7ec9d4966b319139bf9d8bd Mon Sep 17 00:00:00 2001 From: Robertkill Date: Sat, 7 Mar 2026 10:54:51 +0800 Subject: [PATCH] fix: prevent visual ghosting and flashing during dock position change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed the issue where changing dock position caused visual ghosting and flashing in both X11 and Wayland environments. 1. Prevented size bindings from resetting to 0 during position animations in Wayland by ensuring proper from/to dimension values based on the layout's dockSize. 2. Disabled D.DWindow.shadowColor and borderWidth not only during hideShowAnimation.running but also during dockAnimation.running. This cleanly removes the lingering shadow effects and borders while the window manager translates the native window. fix: 修复任务栏停靠位置改变时的视觉残影和闪烁问题 修复了在X11和Wayland环境下更改任务栏位置时导致视觉残影和闪烁的问题。 1. 通过确保正确返回基于布局当前厚度(dockSize)的from/to插值尺寸,防止了 部分环境下的尺寸插值在位置切换动画期间错误回落归零。 2. 不仅在 hideShowAnimation.running 阶段,还在 dockAnimation.running 阶段同样 禁用了D.DWindow.shadowColor和borderWidth。这干净利落地移除了底层窗口管理器 平移或转换窗口位置时残留的阴影效果和黑色边框。 Log: 修复任务栏在切换位置时产生的残影和闪烁瑕疵 Influence: 1. Test moving the dock position (Top, Bottom, Left, Right) to ensure smooth transitions without graphical artifacts or shadow ghosting. 2. Verify normal dock hide/show toggle works correctly with its respective shadows and borders. 3. Check the behavior under both X11 and Wayland display servers if possible. Influence: 1. 测试移动任务栏位置(上、下、左、右),确保平滑过渡,无图形缺陷或阴影残影。 2. 验证正常的任务栏隐藏/显示切换依然拥有正常的阴影和边框表现。 3. 检查在X11和Wayland双环境下的切换行为一致性。 PMS: BUG-352127 --- panels/dock/package/main.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panels/dock/package/main.qml b/panels/dock/package/main.qml index 266ca9b0d..17263de63 100644 --- a/panels/dock/package/main.qml +++ b/panels/dock/package/main.qml @@ -70,10 +70,10 @@ Window { // 目前直接处理shadowColor(透明和默认值的切换)和borderWidth(0和1的切换),来控制阴影和边框 // 参数默认值见: https://github.com/linuxdeepin/qt5platform-plugins/blob/master/xcb/dframewindow.h#L122 // 需要注意,shadowRadius不能直接套用于“扩散”参数,拿到不透明度100%的设计图确定radius更合适一些。 - D.DWindow.shadowColor: hideShowAnimation.running ? Qt.rgba(0, 0, 0, 0) : Qt.rgba(0, 0, 0, 0.1) + D.DWindow.shadowColor: (hideShowAnimation.running || dockAnimation.running) ? Qt.rgba(0, 0, 0, 0) : Qt.rgba(0, 0, 0, 0.1) D.DWindow.shadowOffset: Qt.point(0, 0) D.DWindow.shadowRadius: 40 - D.DWindow.borderWidth: hideShowAnimation.running ? 0 : 1 + D.DWindow.borderWidth: (hideShowAnimation.running || dockAnimation.running) ? 0 : 1 D.DWindow.enableBlurWindow: Qt.platform.pluginName !== "xcb" D.DWindow.themeType: Panel.colorTheme D.DWindow.borderColor: D.DTK.themeType === D.ApplicationHelper.DarkType ? Qt.rgba(0, 0, 0, dock.blendColorAlpha(0.6) + 20 / 255) : Qt.rgba(0, 0, 0, 0.15) @@ -207,11 +207,11 @@ Window { } return 1; } - return 0; + return dockAnimation.useTransformBasedAnimation ? 0 : Panel.dockSize; } to: { if (dockAnimation.isShowing) { - return 0; + return dockAnimation.useTransformBasedAnimation ? 0 : Panel.dockSize; } else { if (dockAnimation.useTransformBasedAnimation) { return (dock.positionForAnimation === Dock.Left || dock.positionForAnimation === Dock.Top) ? -Panel.dockSize : Panel.dockSize;