fix: grub preview flicker on theme toggle - #3413
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 52cyb 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 |
1. Add same-value guard to setGrubThemePath to stop redundant emits 2. Add grubBackgroundRevision counter for cache-busting same-path content 3. Add pending flag to distinguish self-initiated background changes 4. Replace Date.now() with grubBackgroundRevision in BootPage.qml Log: Fixed background preview flicker when toggling boot menu theme or changing background image Influence: 1. Test theme off→on: preview refreshes once, no later flicker 2. Test theme on→off: preview clears with no bounce-back 3. Test dragging new background with theme on (BUG-281399 not regressed) 4. Test dragging background with theme off (auto-enable theme preserved) 5. Test deleting/restoring default background and first page entry fix: 修复启动菜单主题切换后背景预览闪烁 1. 为 setGrubThemePath 增加同值守卫,避免冗余 emit 2. 新增 grubBackgroundRevision 计数器,用于同路径内容变更的缓存失效 3. 新增 pending 标志,区分主动发起的背景变更 4. BootPage.qml 中用 grubBackgroundRevision 替换 Date.now() Log: 修复启动菜单主题切换或更换背景图后背景预览区闪烁问题 Influence: 1. 测试主题关→开:背景预览只刷新一次,稍后不再闪 2. 测试主题开→关:预览清空,无回跳 3. 测试主题开启态拖拽换背景(验证 BUG-281399 未回归) 4. 测试主题关闭态拖拽背景(验证自动开主题原行为保留) 5. 测试删除/恢复默认背景及首次进入页面 PMS: BUG-371485
b7f0a83 to
df96348
Compare
Reviewer's GuideImplements a more precise grub background refresh mechanism by guarding redundant theme path updates, tracking background content revisions, and distinguishing user-initiated background changes so the QML preview reloads only when necessary and without flicker after theme toggles or image changes. Sequence diagram for grub background change and preview refreshsequenceDiagram
actor User
participant BootPageQML
participant CommonInfoWork
participant CommonInfoProxy
participant CommonInfoModel
User->>BootPageQML: dragBackground
BootPageQML->>CommonInfoWork: setBackground(path)
CommonInfoWork->>CommonInfoWork: m_pendingBackgroundRefresh = true
CommonInfoWork->>CommonInfoProxy: setBackground(path)
CommonInfoProxy-->>CommonInfoWork: BackgroundChanged
CommonInfoWork->>CommonInfoWork: pending = m_pendingBackgroundRefresh
CommonInfoWork->>CommonInfoWork: m_pendingBackgroundRefresh = false
alt pending && !CommonInfoModel.themeEnabled()
CommonInfoWork->>CommonInfoWork: setEnableTheme(true)
CommonInfoWork->>CommonInfoModel: setThemeEnabled(true)
end
CommonInfoWork->>CommonInfoModel: setGrubThemePath(backgroundPath)
CommonInfoModel->>CommonInfoModel: guard same m_grubThemePath
alt pending
CommonInfoWork->>CommonInfoModel: bumpGrubBackgroundRevision()
CommonInfoModel-->>BootPageQML: grubBackgroundRevisionChanged
end
CommonInfoModel-->>BootPageQML: grubThemePathChanged
BootPageQML->>BootPageQML: reload Image.source using grubThemePath and grubBackgroundRevision
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review★ 总体评分:79分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 --- a/src/plugin-commoninfo/operation/commoninfowork.cpp
+++ b/src/plugin-commoninfo/operation/commoninfowork.cpp
@@ -209,8 +209,6 @@ CommonInfoWork::CommonInfoWork(CommonInfoModel *model, QObject *parent)
}
QString backgroundPath = m_commonInfoProxy->Background();
- QPixmap pix = QPixmap(backgroundPath);
m_commomModel->setGrubThemePath(backgroundPath);
QDir dir(m_tmpBackgroundPath); |
Log: Fixed background preview flicker when toggling boot menu theme or changing background image
Influence:
fix: 修复启动菜单主题切换后背景预览闪烁
Log: 修复启动菜单主题切换或更换背景图后背景预览区闪烁问题
Influence:
PMS: BUG-371485
Summary by Sourcery
Prevent boot menu background preview flicker when toggling the GRUB theme or changing the background image.
Bug Fixes:
Enhancements: