Conversation
1. Root cause: presentCursors second group only had "left_ptr_watch" with no fallback, themes like Adwaita lack this file causing thumbnail to show 6 states instead of 7 with wrong icon 2. Fix: add "watch" as fallback name, Adwaita provides watch->wait symlink so the busy cursor state loads correctly 3. Impact: themes with left_ptr_watch (e.g. bloom) unaffected as first name matches first, only themes lacking it get the fallback Log: Fix cursor thumbnail showing wrong icon for some themes Influence: 1. Test Adwaita cursor theme thumbnail shows 7 states correctly 2. Test bloom cursor theme thumbnail has no regression 3. Verify second-to-last cursor icon is grab not fleur fix: 修复部分主题光标缩略图图标错误 1. 根因:presentCursors 第2组仅有"left_ptr_watch"无备选名,Adwaita等 主题缺少该文件导致缩略图少显示一个状态且图标错位 2. 方案:添加"watch"作为备选光标名,Adwaita提供watch->wait符号链接 可正确加载忙碌状态光标 3. 影响:已有left_ptr_watch的主题(如bloom)不受影响,仅缺少该名称的 主题启用备选 Log: 修复部分光标主题缩略图图标显示错误 Influence: 1. 测试Adwaita光标主题缩略图正确显示7个状态 2. 测试bloom光标主题缩略图无回归 3. 验证倒数第二个光标图标为grab而非fleur PMS: BUG-375317
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy 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 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe cursor thumbnail mapping now falls back from Flow diagram for cursor thumbnail fallback selectionflowchart TD
A["Cursor theme thumbnail requests left_ptr_watch"] --> B{"left_ptr_watch available?"}
B -->|Yes| C["Use left_ptr_watch"]
B -->|No| D["Use watch"]
C --> E["Display seven cursor states"]
D --> E
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 暂无代码示例本报告由 AI 代码审查工具自动生成 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Root Cause Analysis
The second group in
presentCursors(themethumb.cpp) only contained"left_ptr_watch"with no fallback name. Cursor themes like Adwaita do not provide aleft_ptr_watchfile in theircursors/directory, causing that group to fail loading any cursor image. This reduces the thumbnail from 7 to 6 cursor states, and shifts the remaining icons forward, making the second-to-last icon appear asfleur(four-way arrow) instead ofgrab(fist). Key evidence: Adwaita'scursors/has noleft_ptr_watchbut provideswatch → wait; bloom hasleft_ptr_watch → progressand displays correctly.Fix
Add
"watch"as a fallback cursor name to the second group:{"left_ptr_watch", "watch"}. Themes that already haveleft_ptr_watch(e.g. bloom) are unaffected since the first name is matched first; themes lacking it (e.g. Adwaita) now fall back towatch.Change Safety Assessment
Code Safety
presentCursorsvariable was introduced in the initial commit (2022-08-09) and its structure has not changed since. Line 27 was last touched by a general theme update commit (BUG-296933/296949), not a targeted bug fix — this change does not revert any historical fix.presentCursorsis its own definition atthemethumb.cpp:33; no external callers are affected. The change is purely additive (one extra string in aQStringList).Business Impact Scope
Affected module: cursor theme thumbnail preview in Control Center personalization settings. Users selecting cursor themes lacking
left_ptr_watch(e.g. Adwaita) will now see all 7 cursor states correctly. Themes withleft_ptr_watch(e.g. bloom) remain unchanged.Verification Suggestion
Test Adwaita cursor theme thumbnail: confirm 7 states display correctly with
grabas the second-to-last icon. Test bloom theme: confirm no regression (still 7 states, behavior unchanged).根因分析
presentCursors(themethumb.cpp)第 2 组仅包含"left_ptr_watch",无备选名称。Adwaita 等光标主题的cursors/目录中不存在left_ptr_watch文件,导致该组无法加载任何光标图像,缩略图从 7 个状态减少为 6 个,且因位置前移,倒数第二个图标由 grab(拳头)变为 fleur(四角箭头)。关键证据:Adwaita 无left_ptr_watch但有watch → wait;bloom 有left_ptr_watch → progress,显示正常。修复方案
在第 2 组添加备选光标名称
"watch":{"left_ptr_watch", "watch"}。已有left_ptr_watch的主题(如 bloom)不受影响(第一名称优先匹配);缺少该名称的主题(如 Adwaita)将回退使用watch。改动安全评估
代码安全评估
presentCursors变量在初始提交(2022-08-09)引入,结构此后未变。行 27 上次修改为通用主题更新提交(BUG-296933/296949),非针对性 bug 修复——本次修改不会撤销任何历史修复。presentCursors唯一引用为其自身定义处themethumb.cpp:33,无外部调用者受影响。改动为纯数据补全(QStringList中增加一个字符串)。业务影响范围
受影响模块:控制中心个性化设置中的光标主题缩略图预览。用户选择缺少
left_ptr_watch的光标主题(如 Adwaita)时,将正确显示 7 个光标状态。已有left_ptr_watch的主题(如 bloom)行为不变。验证建议
测试 Adwaita 光标主题缩略图:确认 7 个状态完整显示,倒数第二个为 grab(拳头)。测试 bloom 主题:确认无回归(仍为 7 个状态,行为不变)。
Summary by Sourcery
Bug Fixes:
left_ptr_watchcan display the complete cursor thumbnail.