Skip to content

fix(view): reset inactive state after right-click#467

Merged
wyu71 merged 1 commit into
linuxdeepin:masterfrom
wyu71:master
Jul 24, 2026
Merged

fix(view): reset inactive state after right-click#467
wyu71 merged 1 commit into
linuxdeepin:masterfrom
wyu71:master

Conversation

@wyu71

@wyu71 wyu71 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Reset the inactive marker when a right-button release completes. 右键释放完成时复位窗口失焦标记。

Log: 修复失焦后右键导致首次空白点击无法取消选中
Influence: 缩略图列表右键菜单后的空白点击可正常取消选中

Reset the inactive marker when a right-button release completes.
右键释放完成时复位窗口失焦标记。

Log: 修复失焦后右键导致首次空白点击无法取消选中
Influence: 缩略图列表右键菜单后的空白点击可正常取消选中

@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 @wyu71, 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

deepin pr auto review

★ 总体评分:95分

■ 【总体评价】

代码修复了窗口失焦后右键点击缩略图列表导致交互异常的问题,逻辑清晰且改动精准。
修复方案正确,无安全漏洞,仅在代码注释方面有微小提升空间,故扣5分。

■ 【详细分析】

  • 1.语法逻辑(完全正确)✓

ThumbnailListViewAlbum.qmlonReleased 事件处理函数中,当检测到 mouse.button === Qt.RightButton 时,将 GStatus.windowDisActived 置为 false。这正确修复了 main.qml 中窗口失去焦点时将该标志置为 true 而未被及时重置的问题,恢复了后续的选择逻辑(如行224和277的判断)。
潜在问题:无
建议:无需修改

  • 2.代码质量(良好)✓

代码改动极简,直接针对问题根源,符合最小改动原则。变量名 windowDisActived 虽由其他模块定义,但在此处的使用语义明确。
潜在问题:缺少针对该状态重置的注释说明,未来维护者可能不清楚为何在右键释放时需要重置窗口失焦状态。
建议:在 GStatus.windowDisActived = false 上方添加简短注释,说明是为了防止窗口失焦状态影响右键菜单交互。

  • 3.代码性能(无性能问题)✓

仅包含简单的布尔值赋值操作,时间复杂度为 O(1),无任何性能损耗。
潜在问题:无
建议:无需修改

  • 4.代码安全(存在0个安全漏洞)✓

漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个
本次修改仅涉及 UI 交互状态标志位的重置,不涉及任何外部输入解析、系统命令调用或敏感数据操作,不存在安全风险。

  • 建议:无需安全相关修复

■ 【改进建议代码示例】

// ThumbnailListViewAlbum.qml: 修复点,右键释放时重置状态
        onReleased: (mouse)=> {
            if (mouse.button === Qt.RightButton) {
                // 重置窗口失焦状态,防止影响右键菜单及后续选择逻辑
                GStatus.windowDisActived = false
                pressCanceled();
                return;
            }

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pengfeixx, wyu71

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

@wyu71
wyu71 merged commit 8716064 into linuxdeepin:master Jul 24, 2026
17 checks passed
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