Conversation
1. Root cause: dual ApplicationWindow visible-toggle re-renders from scratch on 4K; 100ms artificial delay in setCurrentFrameToWindowedFrame plus EffectOut startup animation compound main-thread blocking ~2s 2. Fix: replace QTimer::singleShot(100,...) with singleShot(0,...) to queue on next event loop iteration without fixed delay; change windowStartUpEffect from EffectOut to EffectNone to skip 4K fullscreen startup animation rendering 3. Impact: fullscreen-windowed mode switch is faster; fullscreen window no longer plays startup animation; potential regression of BUG-323633 visual glitch needs runtime verification Log: Reduce launcher mode switch stutter on 4K screens Influence: 1. Test fullscreen-windowed switch on 4K for stutter improvement 2. Test fullscreen-windowed switch on 1080p for no regression 3. Verify no window flicker or focus loss on fullscreen-windowed switch 4. Verify fullscreen window shows/hides correctly without animation fix: 降低4K屏幕下全屏窗口模式切换卡顿 1. 根因:双 ApplicationWindow 通过 visible 互斥切换在 4K 下需从零渲染, 100ms 人工延迟叠加 EffectOut 启动特效渲染导致主线程阻塞约 2s 2. 方案:将 QTimer::singleShot(100,...) 改为 singleShot(0,...), 排队到下一事件循环执行无固定延迟;将 windowStartUpEffect 从 EffectOut 改为 EffectNone,跳过 4K 全屏启动特效渲染 3. 影响:全屏-窗口模式切换速度提升;全屏窗口不再播放启动动画; BUG-323633 视觉故障可能回归,需运行时验证 Log: 降低启动器在4K屏幕下模式切换的卡顿 Influence: 1. 在4K分辨率下测试全屏-窗口模式切换卡顿是否改善 2. 在1080p分辨率下测试全屏-窗口模式切换无回归 3. 验证全屏-窗口切换时无窗口闪烁或焦点丢失 4. 验证全屏窗口正常显示/隐藏(无动画过渡) PMS: BUG-354837
|
[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 GuideReduces fullscreen/windowed switching stutter, especially on 4K displays, by replacing the 100 ms switch delay with queued execution and disabling the fullscreen startup animation in both launcher window implementations. Reviewers should verify that focus loss or window flicker from the shorter delay does not regress, particularly during fullscreen-to-windowed transitions. Sequence diagram for faster fullscreen-to-windowed switchingsequenceDiagram
participant LauncherController
participant EventLoop
participant Window
LauncherController->>Window: setVisible(false)
LauncherController->>EventLoop: QTimer.singleShot(0)
EventLoop-->>LauncherController: queued callback
LauncherController->>Window: setCurrentFrame("WindowedFrame")
LauncherController->>Window: setVisible(true)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
📋 变更概要
🔍 详细分析1. 语法逻辑 ✅评分: 25/25 ✓ "语法正确,逻辑清晰" 变更分析:
潜在问题: 建议: 无 2. 代码质量 ✅评分: 25/25 ✓ "代码结构清晰,注释完整" 变更分析:
潜在问题: 建议: 无 3. 代码性能 ✅评分: 20/20 ✓ "性能良好,资源使用合理" 变更分析:
潜在问题: 建议: 无 4. 代码安全 🔒评分: 30/30 ✓ "存在0个安全漏洞"
安全分析:
漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 安全漏洞详情: 建议: 无 📈 评分汇总
🔧 OCR 审查结果
本报告由 AI 代码审查工具自动生成 |
|
没有根本解决问题,这个是性能问题 |
Root Cause Analysis
Launcher mode switching uses two independent
ApplicationWindowinstances toggled viavisiblebinding. On 4K resolution, the target window re-renders all content from scratch, whereStyledBehindWindowBlurreal-time blur (Main.qml:220,246) andEffectOutstartup animation (Main.qml:319) compound the rendering cost. Additionally, a 100ms artificial delay (launchercontroller.cpp:274,QTimer::singleShot(100, ...)) blocks the switch path. Together these block the main thread ~2s on 4K displays.Fix Approach
Replace the 100ms fixed delay with
QTimer::singleShot(0, ...)(queued to next event loop iteration, equivalent toQt.callLater()), and changewindowStartUpEffectfromEffectOuttoEffectNoneto skip the 4K fullscreen startup animation rendering. The sameEffectOut→EffectNonechange is applied to the mirror fileshell-launcher-applet/package/launcheritem.qml.Change Safety Assessment
Code Safety
EffectOutwas introduced for developer-center#10322 fullscreen open/close animation. Changing toEffectNoneintentionally removes this animation to eliminate 4K rendering overhead.Business Impact Scope
Affected module: Launcher mode switching (fullscreen ↔ windowed). Users on 4K displays will experience faster mode switching. Side effect: fullscreen window no longer plays startup animation (window appears/disappears directly instead of animated transition). Potential regression: window flicker on fullscreen→windowed switch (BUG-323633) needs verification.
Verification Suggestion
Test fullscreen↔windowed switching on 4K (verify stutter improvement, target <1s) and 1080p (verify no regression). Specifically check for window flicker or focus loss on fullscreen→windowed transition.
根因分析
启动器模式切换使用两个独立的
ApplicationWindow实例,通过visible绑定互斥显示。在 4K 分辨率下,目标窗口需从零渲染全部内容,StyledBehindWindowBlur实时模糊(Main.qml:220,246)和EffectOut启动特效(Main.qml:319)叠加渲染开销。此外,100ms 人工延迟(launchercontroller.cpp:274,QTimer::singleShot(100, ...))阻塞切换流程。以上因素叠加导致 4K 下主线程阻塞约 2s。修复方案
将 100ms 固定延迟替换为
QTimer::singleShot(0, ...)(排队到下一事件循环执行,等价于Qt.callLater()),并将windowStartUpEffect从EffectOut改为EffectNone,跳过 4K 全屏启动特效渲染。镜像文件shell-launcher-applet/package/launcheritem.qml同步修改EffectOut→EffectNone。改动安全评估
代码安全评估
EffectOut由 developer-center#10322 引入用于全屏开合动画。改为EffectNone是有意移除该动画以消除 4K 渲染开销。业务影响范围
受影响模块:启动器模式切换(全屏↔窗口)。4K 屏幕用户将体验到更快的模式切换。副作用:全屏窗口不再播放启动动画(窗口直接出现/消失而非动画过渡)。潜在回归:全屏→窗口切换时可能出现窗口闪烁(BUG-323633),需验证。
验证建议
在 4K 分辨率下测试全屏↔窗口切换(验证卡顿改善,目标 <1s),在 1080p 下测试无回归。重点检查全屏→窗口切换时是否有窗口闪烁或焦点丢失。
PMS: BUG-354837
Summary by Sourcery
Improve launcher mode switching responsiveness by eliminating unnecessary delay and fullscreen startup animation overhead.
Bug Fixes:
Enhancements:
Tests: