Package Details: wechat-appimage 4.0.1.99-2

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: wechat
Submitter: fengch
Maintainer: fengch
Last Packager: fengch
Votes: 8
Popularity: 3.58
First Submitted: 2024-12-09 01:52 (UTC)
Last Updated: 2025-01-21 07:59 (UTC)

Pinned Comments

fengch commented on 2025-01-03 08:26 (UTC)

注意,提交过期前确认一下,本包只包含了3位版本号,第4位为打包版本,因为腾讯在 appimage 文件中配置的版本号只到 第3位(第4位在二进制文件中,提取起来比较麻烦),所以是以3位版本+打包序号发布的,不要看错 另外已经配置了自动化脚本,每4小时自动检查腾讯是否发布新版本,检测到新版本会自动更新打包版本,如果超过4小时没有自动更新,一般是脚本出错了,这边会收到通知调整脚本

Latest Comments

« First ‹ Previous 1 2 3 Next › Last »

wszqkzqk commented on 2025-01-09 08:23 (UTC)

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.

fengch commented on 2025-01-09 07:57 (UTC) (edited on 2025-01-09 08:38 (UTC) by fengch)

@wszqkzqk

研究了一下kde的缩放机制,确认这个一个上游bug 首先这个配置来自代码plasma-workspace

plasma 明确的禁止了qt的自动缩放功能,为什么呢?

在 x11 环境中,kde的所有缩放由系统统一完成,所以需要明确的告诉qt应用程序,禁用自动缩放,这个配置是没有问题的

在 wayland 环境中执行 Xwayland 应用程序时情况发生了变化 plasma 在 KScreen 中增加了一个 配置 XwaylandClientsScale 在控制应用程序的缩放是系统还是应用程序自行完成,但实际上XwaylandClientsScale 配置为true时,在qt中因为 QT_AUTO_SCREEN_SCALE_FACTOR 写了0 而放弃了自动缩放


The following is from Google Translate

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.

wszqkzqk commented on 2025-01-09 03:13 (UTC) (edited on 2025-01-09 03:52 (UTC) by wszqkzqk)

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

yifwon commented on 2025-01-09 02:37 (UTC)

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.

yifwon commented on 2025-01-09 02:32 (UTC)

Considering add this env variable QT_AUTO_SCREEN_SCALE_FACTOR=1 to support suitable resolution dispaly on wayland ?

fengch commented on 2025-01-09 01:51 (UTC)

nice @wszqkzqk

wszqkzqk commented on 2025-01-09 01:14 (UTC) (edited on 2025-01-09 01:15 (UTC) by wszqkzqk)

Considering the ibus input method and the scaling under wayland, are you willing to try this? @fengch

diff --git a/wechat b/wechat
index 5273199..90cd072 100755
--- a/wechat
+++ b/wechat
@@ -1,6 +1,16 @@
 #!/bin/sh

-: ${QT_IM_MODULE:="fcitx"}
+case "${XMODIFIERS}" in
+    *@im=ibus*)
+        : ${QT_IM_MODULE:=ibus}
+        ;;
+    *)
+        : ${QT_IM_MODULE:=fcitx}
+        ;;
+esac
+
+: ${QT_AUTO_SCREEN_SCALE_FACTOR:=1}

 export QT_IM_MODULE
+export QT_AUTO_SCREEN_SCALE_FACTOR
 exec /opt/wechat-appimage/wechat-appimage.AppImage $@

sergefan commented on 2025-01-08 14:47 (UTC)

太对了哥,要的就是这种一个包全打好即插即用的。

fengch commented on 2025-01-07 09:24 (UTC)

其实不用加这么多,指定一下 QT_IM_MODULE 这个就行

mrLian commented on 2025-01-05 13:34 (UTC)

在.desktop文件里修改了一下启动变量后能正常使用输入法了,好像是用不了fcitx5。如果有下个版本的话可以考虑一下.env这样的文件

Exec=env DESKTOPINTEGRATION=false GTK_IM_MODULE=fcitx QT_IM_MODULE=fcitx QT_IM_MODULE=fcitx XMODIFIERS=@im=fcitx /usr/bin/wechat %U