fix(dock): smart hide fails to show dock after window dragged away#1668
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: fly602, wjyrich The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/force merge |
SmartHide 模式下,show 动画结束后 onStopped 无条件重启 hideTimer,
导致 dock 显示后 500ms 又被隐藏。同时 onHideStateChanged 的 Show
分支未停掉 QML hideTimer,且 hideShowAnimation.restart() 可能被
已运行的动画阻塞。
1. onStopped 中增加 Panel.hideState !== Dock.Show 判断,Show 状态
下不再重启 hideTimer
2. onHideStateChanged Show 分支中先 hideTimer.stop() 再 restart()
show 动画,并强制设置 dock.visible = true
Log: 修复 SmartHide 模式下拖动窗口脱离任务栏后任务栏不自动显示的问题
PMS: BUG-370149
Influence:
1. SmartHide 模式下拖动窗口与任务栏重叠后移开,验证任务栏自动显示
2. SmartHide 模式下快速反复拖动窗口进出任务栏区域,验证无闪烁或卡住
3. KeepShowing 和 KeepHidden 模式下验证任务栏行为无回归
4. 任务栏显示动画过程中再次触发隐藏,验证动画状态正确切换
5. 右键菜单弹出时拖动窗口,验证菜单和任务栏状态无冲突
|
/force merge |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
deepin pr auto review★ 总体评分:100分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 当前代码已完美修复竞态条件,无需进一步修改。
// 以下为当前修复后的核心逻辑确认:
Connections {
function onBeforePositionChanged(beforePosition) {
// Prevent the delayed hide animation from racing the position animation.
hideTimer.stop();
// Stop any running animations first
dockAnimation.stop();
hideShowAnimation.stop();
}
function onHideStateChanged() {
if (Panel.hideState === Dock.Hide) {
hideTimer.restart()
} else if (Panel.hideState === Dock.Show) {
hideTimer.stop()
// Reverse an in-flight hide animation, but do not restart an
// animation that is already moving towards the shown state.
if (!hideShowAnimation.running || hideShowAnimation.hiding || !dock.visible) {
hideShowAnimation.restart()
}
dock.visible = true
}
}
} |
SmartHide 模式下,show 动画结束后 onStopped 无条件重启 hideTimer,
导致 dock 显示后 500ms 又被隐藏。同时 onHideStateChanged 的 Show
分支未停掉 QML hideTimer,且 hideShowAnimation.restart() 可能被
已运行的动画阻塞。
Log: 修复 SmartHide 模式下拖动窗口脱离任务栏后任务栏不自动显示的问题
PMS: BUG-370149
Influence: