@wszqkzqk
Sorry, added a note
| Git Clone URL: | https://aur.archlinux.org/wechat-appimage.git (read-only, click to copy) |
|---|---|
| Package Base: | wechat-appimage |
| Description: | Wechat for Linux |
| Upstream URL: | https://linux.weixin.qq.com |
| Keywords: | appimage wechat wechatlinux weixin |
| Licenses: | custom |
| Provides: | |
| Submitter: | fengch |
| Maintainer: | fengch |
| Last Packager: | fengch |
| Votes: | 21 |
| Popularity: | 0.95 |
| First Submitted: | 2024-12-09 01:52 (UTC) |
| Last Updated: | 2026-03-10 08:56 (UTC) |
@wszqkzqk
Sorry, added a note
我尽量以副作用最小的方式去修改了,但是副作用依然存在,如果一个使用kde且在wayland环境,且配置了XwaylandClientsScale=true的用户将永远无法禁用微信的自动缩放
Please also update the checksum of wechat script in PKGBUILD
这边我会为这个包提供一个补丁修补这行为差异,直到上游被修补
I will provide a patch for this package to fix this behavior difference until it is fixed upstream.
另外 QT_SCALE_FACTOR 不需要特意去处理,准循qt的默认行为,你可以理解为额外的全局缩放
I also find a bug report: https://bugs.kde.org/show_bug.cgi?id=469273
But there is no further discussion on the issue upstream yet.
@wszqkzqk
研究了一下kde的缩放机制,确认这个一个上游bug 首先这个配置来自代码plasma-workspace
plasma 明确的禁止了qt的自动缩放功能,为什么呢?
在 x11 环境中,kde的所有缩放由系统统一完成,所以需要明确的告诉qt应用程序,禁用自动缩放,这个配置是没有问题的
在 wayland 环境中执行 Xwayland 应用程序时情况发生了变化 plasma 在 KScreen 中增加了一个 配置 XwaylandClientsScale 在控制应用程序的缩放是系统还是应用程序自行完成,但实际上XwaylandClientsScale 配置为true时,在qt中因为 QT_AUTO_SCREEN_SCALE_FACTOR 写了0 而放弃了自动缩放
After studying the scaling mechanism of KDE, I confirmed that this is an upstream bug. First of all, this configuration comes from the code plasma-workspace
Plasma explicitly disables the automatic scaling function of Qt. Why?
In the X11 environment, all scaling of KDE is done by the system, so it is necessary to explicitly tell the Qt application to disable automatic scaling. This configuration is no problem
The situation changes when executing Xwayland applications in the wayland environment. Plasma adds a configuration XwaylandClientsScale in KScreen to control whether the scaling of the application is done by the system or the application itself. But in fact, when XwaylandClientsScale is configured to true, the automatic scaling is abandoned in Qt because QT_AUTO_SCREEN_SCALE_FACTOR is written as 0.
Emmmm... There is another problem that KDE forced to set QT_AUTO_SCREEN_SCALE_FACTOR=0 and users cannot manually change it.
Ref:
1. KDE Discuss 2406/4
2. KDE Discuss 2406/5
QT_AUTO_SCREEN_SCALE_FACTOR for KDE users is always 0 and editing /etc/profile or ~/.profile, etc. has no effect. Moreover, wechat is using an old version of Qt that doesn't recognize variables such as QT_FONT_DPI set by KDE. Thus, with current settings, wechat can never be scaled under KDE.
I've made a new workaround for KDE, would you please try this:
diff --git a/wechat b/wechat
index d9aeb49..0af7535 100755
--- a/wechat
+++ b/wechat
@@ -10,7 +10,16 @@ case "${XMODIFIERS}" in
esac
export QT_IM_MODULE
-: ${QT_AUTO_SCREEN_SCALE_FACTOR:=1}
-export QT_AUTO_SCREEN_SCALE_FACTOR
+# Workaround for scaling with KDE Plasma
+if [[ -n "$QT_SCALE_FACTOR" ]]; then
+ export QT_SCALE_FACTOR
+else
+ if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]]; then
+ QT_AUTO_SCREEN_SCALE_FACTOR=1
+ else
+ : ${QT_AUTO_SCREEN_SCALE_FACTOR:=1}
+ fi
+ export QT_AUTO_SCREEN_SCALE_FACTOR
+fi
exec /opt/wechat-appimage/wechat-appimage.AppImage $@
# Workaround for scaling with KDE Plasma
if [[ -n "$QT_SCALE_FACTOR" ]]; then
export QT_SCALE_FACTOR
else
if [[ "$XDG_CURRENT_DESKTOP" == *"KDE"* ]]; then
QT_AUTO_SCREEN_SCALE_FACTOR=1
else
: ${QT_AUTO_SCREEN_SCALE_FACTOR:=1}
fi
export QT_AUTO_SCREEN_SCALE_FACTOR
fi
It also enables users to manually set scale factor by QT_SCALE_FACTOR. I've tested it on KDE Plasma and it works fine. /cc @yifwon @fengch
Oh, I just see @wszqkzqk's comment now. and fcitx added will be better, I save this env in /etc/environment now. Thanks a lot.
Considering add this env variable QT_AUTO_SCREEN_SCALE_FACTOR=1 to support suitable resolution dispaly on wayland ?
Pinned Comments
fengch commented on 2025-01-03 08:26 (UTC)
注意,提交过期前确认一下,本包只包含了3位版本号,第4位为打包版本,因为腾讯在 appimage 文件中配置的版本号只到 第3位(第4位在二进制文件中,提取起来比较麻烦),所以是以3位版本+打包序号发布的,不要看错 另外已经配置了自动化脚本,每4小时自动检查腾讯是否发布新版本,检测到新版本会自动更新打包版本,如果超过4小时没有自动更新,一般是脚本出错了,这边会收到通知调整脚本