Skip to content

fix: reset blur state on context destroy in PersonalizationWindowContextV1#993

Open
deepin-wm wants to merge 2 commits into
linuxdeepin:masterfrom
deepin-wm:fix/personalization-blur-reset
Open

fix: reset blur state on context destroy in PersonalizationWindowContextV1#993
deepin-wm wants to merge 2 commits into
linuxdeepin:masterfrom
deepin-wm:fix/personalization-blur-reset

Conversation

@deepin-wm

Copy link
Copy Markdown
Contributor
  • Verify no stale signal connections cause unexpected blur state changes

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @deepin-wm, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: deepin-wm

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

…extV1

1. Reset m_backgroundType to Normal and other properties when PersonalizationWindowContextV1 is destroyed, and emit corresponding changed signals to notify downstream observers

2. Add m_target validity check in destroyed callback to prevent reconnecting signals after surface becomes invalid

3. Disconnect m_contextDestroyedConnection in update lambda and aboutToBeInvalidated handler to avoid stale destroyed connections when new context replaces old one

4. Replace magic numbers 0-2 in set_blend_mode validation with protocol enum constants TREELAND_PERSONALIZATION_WINDOW_CONTEXT_V1_BLEND_MODE_TRANSPARENT/BLUR

5. Extract update logic into updateFromContext method to fix auto self-reference compilation error

Log: Fixed window blur effect persisting after the requesting context was destroyed

Influence:

1. Test that blur effect is removed when the personalization window context is destroyed

2. Test that a new context can correctly re-apply blur after the old one is destroyed

3. Test that invalid blend mode values are rejected with protocol error

4. Verify no stale signal connections cause unexpected blur state changes

fix: PersonalizationWindowContextV1销毁时重置blur状态

1. PersonalizationWindowContextV1销毁时将m_backgroundType重置为Normal并发射changed信号,通知下游观察者状态变化

2. destroyed回调中增加m_target有效性检查,防止surface无效后重连信号

3. update lambda和aboutToBeInvalidated处理器中断开m_contextDestroyedConnection,避免新context替换旧context时残留destroyed连接

4. set_blend_mode参数验证使用协议枚举常量替代魔法数字0-2

5. 提取更新逻辑为updateFromContext方法,修复auto自引用编译错误

Log: 修复窗口模糊效果在请求上下文销毁后仍然残留的问题

Influence:

1. 测试personalization window context销毁后blur效果是否正确移除

2. 测试旧context销毁后新context能否正确重新应用blur

3. 测试无效blend mode值是否被协议错误拒绝

4. 验证无残留信号连接导致意外的blur状态变化
@deepin-wm deepin-wm force-pushed the fix/personalization-blur-reset branch from 80fab16 to 26d3e78 Compare June 16, 2026 08:00
1. Add test_window_blur example with manual context create/destroy and blend mode toggle controls

2. Implement 4 automated test scenarios: blur then destroy, normal blur, destroy then recreate without blur, destroy then set transparent

3. Add m_scenarioRunning guard to prevent overlapping timed scenarios

4. Use deleteLater() instead of delete for window context to avoid destroy+delete timing issues

Influence:

1. Verify blur effect is removed when context is destroyed (Scenario A)

2. Verify blur displays correctly when requested (Scenario B)

3. Verify no residual blur after context destroy and recreate without blur (Scenario C)

4. Verify blur correctly switches when context destroyed then recreated with transparent mode (Scenario D)

test: 新增窗口模糊测试工具验证personalization协议

1. 添加test_window_blur示例,支持手动创建/销毁context和切换blend mode

2. 实现4个自动化测试场景:blur后销毁、正常blur、销毁后重建不设blur、销毁后设transparent

3. 添加m_scenarioRunning标志位防止定时场景交错执行

4. 使用deleteLater()替代delete避免destroy+delete时序问题

Influence:

1. 验证context销毁后blur效果正确消失(场景A)

2. 验证请求blur时模糊正常显示(场景B)

3. 验证销毁后重建context不设blur时无残留模糊(场景C)

4. 验证销毁后重建context设transparent时模糊正确切换(场景D)
@deepin-wm deepin-wm force-pushed the fix/personalization-blur-reset branch from 6984131 to e828a3b Compare June 17, 2026 03:38
@deepin-bot

deepin-bot Bot commented Jun 17, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 0.8.11
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #999

@zorowk

zorowk commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

测试的例子在不修改协议的情况下运行一遍会导致设置透明和模糊都失效
测试例子在修改协议情况下运行正常

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants