Conversation
Disable Qt QML rendering VSync by setting QSG_NO_VSYNC=1 before QGuiApplication creation. The transparent window + blur effect in DCC amplifies VSync-induced frame delay, causing visible vertical content jitter when resizing window height from the bottom edge. Log: fix window height resize page jitter Bug: https://pms.uniontech.com/bug-view-317921.html
|
[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 PR disables Qt QML VSync at process startup, addressing bottom-edge window resize jitter and top blank-area artifacts caused by delayed frame presentation in the transparent, blurred DCC window. Review should focus on confirming the environment variable is set before QGuiApplication initialization and validating resizing, high-DPI rendering, page navigation, scrolling, and possible screen-tearing tradeoffs. Sequence diagram for disabling QML VSync before application startupsequenceDiagram
participant Main as main
participant Env as QtEnvironment
participant App as QGuiApplication
participant QML as QMLRendering
participant Window as DCCWindow
Main->>Env: qputenv(QSG_NO_VSYNC, 1)
Main->>App: QGuiApplication(argc, argv)
App->>QML: Initialize rendering pipeline
QML-->>Window: Present frames without VSync delay
Window-->>Main: Resize without vertical jitter
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto reviewAI 代码审查报告
总体评价
漏洞统计
漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 四维度评分
维度1:语法逻辑(25/25 ✓)
分析
变更代码// src/dde-control-center/main.cpp:95
int main(int argc, char *argv[])
{
qputenv("QSG_NO_VSYNC", "1"); // 新增:禁用 VSync
QGuiApplication *app = new QGuiApplication(argc, argv);维度2:代码质量(23/25 ✓)
检查项
改进建议建议在新增行添加内联注释,说明禁用 VSync 的原因: int main(int argc, char *argv[])
{
// 禁用 VSync,修复窗口高度调整时 OpenGL/Qt 坐标系差异导致的内容跳动
qputenv("QSG_NO_VSYNC", "1");
QGuiApplication *app = new QGuiApplication(argc, argv);维度3:代码性能(19/20 ✓)
分析
轻微建议全局禁用 VSync 可能影响所有页面的渲染同步行为。建议后续考虑条件化禁用(如仅在特定渲染场景或特定平台下禁用),以减少对正常页面浏览时渲染质量的潜在影响。 维度4:代码安全(30/30 ✓)
安全检查
审查结论本次变更目的明确——通过禁用 Qt QML 渲染管线的 VSync 修复窗口高度调整时的内容跳动问题。代码实现与 commit 目的完全一致:
建议:可考虑添加内联注释说明禁用 VSync 的原因,提升代码可维护性。 |
|
TAG Bot New tag: 6.1.109 |
Root Cause Analysis
When resizing the DCC window height from the bottom edge, the page content jitters vertically and a blank area appears at the top. The root cause is Qt QML rendering pipeline's VSync (vertical synchronization) combined with the OpenGL/Qt coordinate system difference (OpenGL origin at bottom-left vs Qt origin at top-left). DCC's transparent window + blur effect (
color: "transparent"+D.StyledBehindWindowBlur) amplifies the per-frame recomposition load, making the VSync-induced frame delay visibly manifest as vertical content offset.Key evidence:
main.cpp:95— NoQSG_NO_VSYNCenvironment variable set beforeQGuiApplicationcreationexport QSG_NO_VSYNC=1; dde-control-center --showeliminates the jitterFix
Add
qputenv("QSG_NO_VSYNC", "1")beforeQGuiApplicationcreation insrc/dde-control-center/main.cppto disable VSync in the Qt QML rendering pipeline, eliminating the frame presentation delay that causes the coordinate offset.Change Safety Assessment
Risk Level: Low
qputenvcall), no function signature changes, no existing logic modified. Blame history confirms target lines are from initial v25 migration, not a prior bug fix — no regression risk from reverting previous fixes.根因分析
从窗口底部边缘调整 DCC 窗口高度时,页面内容垂直跳动且顶部出现空白区域。根因是 Qt QML 渲染管线的 VSync(垂直同步)与 OpenGL/Qt 坐标系差异(OpenGL 原点在左下角,Qt 原点在左上角)共同作用。DCC 的透明窗口+毛玻璃效果(
color: "transparent"+D.StyledBehindWindowBlur)放大了每帧重合成负载,使 VSync 引起的帧延迟表现为可见的内容垂直偏移。关键证据:
main.cpp:95—QGuiApplication创建前未设置QSG_NO_VSYNC环境变量export QSG_NO_VSYNC=1; dde-control-center --show后跳动消失修复方案
在
src/dde-control-center/main.cpp的QGuiApplication创建前添加qputenv("QSG_NO_VSYNC", "1"),禁用 Qt QML 渲染管线的 VSync,消除帧呈现延迟导致的坐标偏移。改动安全评估
风险等级:低风险
qputenv调用,不修改函数签名、不改变现有逻辑。Blame 历史确认目标代码行来自 v25 初始迁移,非历史 bug 修复产物,不存在撤销历史修复的回归风险。Summary by Sourcery
Bug Fixes: