From 81ce6dfe7e69b67267dd35bf0055802de9b481ce Mon Sep 17 00:00:00 2001 From: zhangkun Date: Mon, 8 Dec 2025 10:51:59 +0800 Subject: [PATCH] fix: correct DPI scaling value in XSettings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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中 --- src/plugin-qt/xsettings/impl/xsettingsmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin-qt/xsettings/impl/xsettingsmanager.cpp b/src/plugin-qt/xsettings/impl/xsettingsmanager.cpp index 65f61b79..ff67ddd4 100644 --- a/src/plugin-qt/xsettings/impl/xsettingsmanager.cpp +++ b/src/plugin-qt/xsettings/impl/xsettingsmanager.cpp @@ -254,7 +254,7 @@ void XSettingsManager::updateDPI() int tempXftDpi = m_settingDconfig->value(dcKeyXftDpi).toInt(&bOk); if (bOk) { if (tempXftDpi != scaledDpi) { - m_settingDconfig->setValue(dcKeyXftDpi, scale); + m_settingDconfig->setValue(dcKeyXftDpi, scaledDpi); XsSetting setting; setting.prop = dcKeyXftDpi; setting.value = scaledDpi;