fix: correct DPI scaling value in XSettings - #38
Conversation
Fixed a bug where the wrong variable was used when updating Xft DPI setting. Changed from using 'scale' variable to 'scaledDpi' variable to ensure the correct DPI value is stored in the configuration. The issue occurred in the updateDPI() method where the code was incorrectly passing the 'scale' variable instead of 'scaledDpi' when updating the Xft DPI setting in the DConfig. This would cause incorrect DPI values to be stored, potentially leading to improper font scaling and display issues. Influence: 1. Test display scaling with different DPI settings 2. Verify that Xft DPI configuration is correctly updated when display scaling changes 3. Check font rendering quality after DPI changes 4. Test configuration persistence across system restarts 5. Verify that the correct DPI value is stored in DConfig after scaling adjustments fix: 修复XSettings中DPI缩放值的错误 修复了更新Xft DPI设置时使用错误变量的bug。将使用'scale'变量改为使 用'scaledDpi'变量,确保正确的DPI值被存储到配置中。 问题出现在updateDPI()方法中,代码错误地传递了'scale'变量而不 是'scaledDpi'变量来更新DConfig中的Xft DPI设置。这会导致存储错误的DPI值, 可能引起字体缩放和显示问题。 Influence: 1. 测试不同DPI设置下的显示缩放 2. 验证显示缩放改变时Xft DPI配置是否正确更新 3. 检查DPI更改后的字体渲染质量 4. 测试配置在系统重启后的持久性 5. 验证缩放调整后正确的DPI值是否存储在DConfig中
Reviewer's guide (collapsed on small PRs)Reviewer's GuideCorrects the stored Xft DPI configuration by using the computed scaled DPI value instead of the raw scale factor when updating DConfig in updateDPI(), ensuring DPI persistence and font scaling behave as intended. Sequence diagram for corrected DPI update in updateDPIsequenceDiagram
participant DisplayScaleController
participant XSettingsManager
participant DConfig
DisplayScaleController->>XSettingsManager: updateDPI(scale)
XSettingsManager->>XSettingsManager: compute scaledDpi from scale
XSettingsManager->>DConfig: value(dcKeyXftDpi) -> tempXftDpi
DConfig-->>XSettingsManager: tempXftDpi
XSettingsManager->>XSettingsManager: compare tempXftDpi with scaledDpi
alt tempXftDpi != scaledDpi
XSettingsManager->>DConfig: setValue(dcKeyXftDpi, scaledDpi)
XSettingsManager->>XSettingsManager: create XsSetting with value scaledDpi
XSettingsManager->>DisplayScaleController: notify DPI updated
else tempXftDpi == scaledDpi
XSettingsManager->>DisplayScaleController: no change to Xft DPI
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review这是一个很好的代码修复,我来分析一下:
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy, robertkill 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 |
|
/forcemerge |
|
This pr force merged! (status: blocked) |
Fixed a bug where the wrong variable was used when updating Xft DPI setting. Changed from using 'scale' variable to 'scaledDpi' variable to ensure the correct DPI value is stored in the configuration.
The issue occurred in the updateDPI() method where the code was incorrectly passing the 'scale' variable instead of 'scaledDpi' when updating the Xft DPI setting in the DConfig. This would cause incorrect DPI values to be stored, potentially leading to improper font scaling and display issues.
Influence:
fix: 修复XSettings中DPI缩放值的错误
修复了更新Xft DPI设置时使用错误变量的bug。将使用'scale'变量改为使
用'scaledDpi'变量,确保正确的DPI值被存储到配置中。
问题出现在updateDPI()方法中,代码错误地传递了'scale'变量而不
是'scaledDpi'变量来更新DConfig中的Xft DPI设置。这会导致存储错误的DPI值, 可能引起字体缩放和显示问题。
Influence:
Summary by Sourcery
Bug Fixes: