!26 修复Qt应用程序缩放时对字体进行两次缩放导致字体过大的问题
From: @liubuguiii Reviewed-by: @tangjie02 Signed-off-by: @tangjie02
This commit is contained in:
commit
a760713210
@ -0,0 +1,42 @@
|
||||
From 45d7ab7118b99033aca71700c2f5dbded695c53d Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Mon, 15 Aug 2022 14:58:13 +0800
|
||||
Subject: [PATCH] fix(hidpi): Fixed QT font DPI to avoid double scaling
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 设置缩放两倍时,通过QT_FONT_DPI固定QT字体DPI,避免QT_SCALE_FACTOR和Xft.dpi对字体进行两次缩放过大的问题
|
||||
|
||||
Closes #I5LQSK #I5LQQQ
|
||||
---
|
||||
plugins/xsettings/xsettings-manager.cpp | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
diff --git a/plugins/xsettings/xsettings-manager.cpp b/plugins/xsettings/xsettings-manager.cpp
|
||||
index 9612a85..7532668 100644
|
||||
--- a/plugins/xsettings/xsettings-manager.cpp
|
||||
+++ b/plugins/xsettings/xsettings-manager.cpp
|
||||
@@ -346,10 +346,19 @@ void XSettingsManager::scale_change_workarounds(int32_t scale)
|
||||
KLOG_WARNING("There was a problem when setting QT_AUTO_SCREEN_SCALE_FACTOR=0: %s", error.c_str());
|
||||
}
|
||||
|
||||
+
|
||||
+ /* FIXME: 由于QT_SCALE_FACTOR将会放大窗口以及pt大小字体,而缩放将会更改Xft.dpi属性,该属性也会导致qt pt字体大小放大,字体将会放大过多。
|
||||
+ 目前暂时解决方案:缩放两倍时固定Qt字体DPI 96,由QT_SCALE_FACTOR环境变量对窗口以及字体进行放大.
|
||||
+ 后续应弃用QT_SCALE_FACTOR方案
|
||||
+ */
|
||||
if (!XSettingsUtils::update_user_env_variable("QT_SCALE_FACTOR", scale == 2 ? "2" : "1", error))
|
||||
{
|
||||
KLOG_WARNING("There was a problem when setting QT_SCALE_FACTOR=%d: %s", scale, error.c_str());
|
||||
}
|
||||
+ else if ( scale==2 && !XSettingsUtils::update_user_env_variable("QT_FONT_DPI","96",error) )
|
||||
+ {
|
||||
+ KLOG_WARNING("There was a problem when setting QT_FONT_DPI=96: %s", error.c_str());
|
||||
+ }
|
||||
}
|
||||
}
|
||||
else
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
Name: kiran-cc-daemon
|
||||
Version: 2.3.1
|
||||
Release: 2
|
||||
Release: 3
|
||||
Summary: DBus daemon for Kiran Desktop
|
||||
|
||||
License: MulanPSL-2.0
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
Patch0001: 0001-fix-coredump-Fix-coredump-problem-caused-by-nullpoin.patch
|
||||
Patch0002: 0001-fix-hidpi-Fixed-QT-font-DPI-to-avoid-double-scaling.patch
|
||||
|
||||
|
||||
BuildRequires: cmake >= 3.2
|
||||
@ -146,6 +147,9 @@ glib-compile-schemas /usr/share/glib-2.0/schemas &> /dev/nulls || :
|
||||
%{_libdir}/pkgconfig/kiran-cc-daemon.pc
|
||||
|
||||
%changelog
|
||||
* Mon Aug 15 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.1-3
|
||||
- KYOS-F: Fixed QT font DPI to avoid double scaling(#I5LQSK,#I5LQQQ)
|
||||
|
||||
* Tue Aug 09 2022 tangjie02 <tangjie02@kylinsec.com.cn> - 2.3.1-2
|
||||
- KYOS-B: Fix coredump problem caused by nullpointer to SPwd.
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user