Skip to content

Conversation

@dengzhongyuan365-dev
Copy link

  • in treeland text edit flow, render via paintImage (treeland frame) instead of fullscreen grab to avoid empty pixmap
  • when text input is open, force text edits to read-only, clear selection, then hide editor to commit content before saving
  • keeps non-treeland and non-text paths unchanged

修复:文本保存走 treeland 帧并强制提交文本

  • treeland 文本流程改用 paintImage(treeland 帧叠加文字),避免全屏抓取为空图
  • 输入框未关闭时,强制设为只读并清理选中,再隐藏编辑层,确保内容提交后保存
  • 其他模式与非文本路径保持不变

bug: https://pms.uniontech.com/bug-view-342885.html

- in treeland text edit flow, render via paintImage (treeland frame) instead of fullscreen grab to avoid empty pixmap
- when text input is open, force text edits to read-only, clear selection, then hide editor to commit content before saving
- keeps non-treeland and non-text paths unchanged

修复:文本保存走 treeland 帧并强制提交文本
- treeland 文本流程改用 paintImage(treeland 帧叠加文字),避免全屏抓取为空图
- 输入框未关闭时,强制设为只读并清理选中,再隐藏编辑层,确保内容提交后保存
- 其他模式与非文本路径保持不变

bug: https://pms.uniontech.com/bug-view-342885.html
@deepin-ci-robot
Copy link

deepin pr auto review

我来对这个diff进行代码审查:

  1. 语法逻辑:
  • 代码逻辑结构清晰,通过条件判断区分Treeland模式和非Treeland模式的处理方式
  • 变量命名规范,如adjustedX、adjustedY等符合驼峰命名法
  • 代码缩进统一,格式规范
  1. 代码质量:
  • 优点:

    • 添加了对Treeland模式的特殊处理,提高了代码的适应性
    • 在隐藏截图编辑界面前,增加了强制结束文本编辑和清除选中的操作,确保状态正确
    • 保留了详细的调试日志输出,便于问题排查
  • 可改进之处:

    • 建议将边界调整的逻辑抽取为独立函数,提高代码复用性
    • 可以将调试日志输出封装为单独的函数,避免重复代码
  1. 代码性能:
  • 在Treeland模式下直接使用paintImage(),避免了不必要的屏幕抓取操作,提高了性能
  • 建议考虑缓存m_pixelRatio的计算结果,避免重复计算
  1. 代码安全:
  • 使用std::max和std::min确保坐标值在合理范围内
  • 建议添加对m_shapesWidget指针的有效性检查,避免可能的空指针访问
  • 建议对target矩形进行有效性验证,确保其尺寸为正数
  1. 其他建议:
  • 可以考虑将Treeland模式的判断逻辑提取为常量或配置项,便于后续维护
  • 建议添加更详细的注释,说明边界调整的具体原因和计算方式
  • 可以考虑将调试日志级别从qCWarning改为qCDebug,避免在正式环境中输出过多调试信息

总体来说,这个改动合理地处理了Treeland模式的特殊情况,代码质量良好,但还有进一步优化的空间。

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: dengzhongyuan365-dev, lzwind

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

@dengzhongyuan365-dev
Copy link
Author

/merge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Dec 11, 2025

This pr cannot be merged! (status: unstable)

@dengzhongyuan365-dev
Copy link
Author

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Dec 11, 2025

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit 1d50bde into linuxdeepin:develop/snipe Dec 11, 2025
7 of 9 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