fix(xsettings): apply X11 scaling live - #148
Conversation
1. Refresh DPI settings after screen scale factors change. 2. Republish Xft DPI even when the persisted value is unchanged. 3. Add tests for DPI persistence and XSettings publication. Log: Apply X11 scale changes without restarting XSettings. Influence: X11 applications receive scaling updates live. fix(xsettings): 实时应用 X11 缩放 1. 屏幕缩放比例变化后立即刷新 DPI 设置。 2. 持久化数值未变化时仍重新发布 Xft DPI。 3. 添加 DPI 持久化和 XSettings 发布测试。 Log: X11 缩放变化无需重启 XSettings 即可生效。 Influence: X11 应用可以实时接收缩放变化。
|
[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 GuideApplies X11 Xft/DPI scaling updates immediately when screen scale factors change, refactors DPI update logic into a reusable helper, always republishes the Xft/DPI XSettings entry while persisting only when needed, and adds a focused QtTest-based unit test plus CMake wiring for it. Sequence diagram for live Xft/DPI update on screen scale changesequenceDiagram
actor System
participant XSettingsManager
participant DConfig as m_settingDconfig
participant XSettingsVector as xsSettngVec
System->>XSettingsManager: setScreenScaleFactors(factors, emitSignal)
XSettingsManager->>XSettingsManager: setScreenScaleFactorsForQt(factors)
XSettingsManager->>XSettingsManager: updateDPI()
XSettingsManager->>DConfig: value(dcKeyXftDpi)
DConfig-->>XSettingsManager: tempXftDpi
XSettingsManager->>XSettingsManager: makeXftDpiUpdate(tempXftDpi, scaledDpi)
XSettingsManager-->>XSettingsManager: XftDpiUpdate update
alt update.needsPersist
XSettingsManager->>DConfig: setValue(dcKeyXftDpi, scaledDpi)
end
XSettingsManager->>XSettingsVector: push_back(update.setting)
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review★ 总体评分:95分■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // common.h 中建议使用更安全的初始化方式(若支持C++20)
inline XftDpiUpdate makeXftDpiUpdate(int storedDpi, int scaledDpi)
{
return {
storedDpi != scaledDpi,
XsSetting{ HeadTypeInteger, QStringLiteral("Xft/DPI"), scaledDpi },
};
} |
|
TAG Bot New tag: 1.0.40 |
|
TAG Bot New tag: 1.0.41 |
Summary
Xft/DPIeven when its persisted value is unchangedVerification
plugin-dde-xsettingsandtst-xftdpiupdatetst-xftdpiupdate: 4 passed, 0 failedDevicePixelRatioChangefrom 2 to 1.98958Summary by Sourcery
Ensure X11 Xft/DPI settings are updated and republished in response to screen scaling changes, and add targeted tests and build wiring for the new DPI update logic.
Bug Fixes:
Enhancements:
Build:
Tests: