求助! idea 启用原生 wayland 后无法使用 fcitx 中文输入法

243 天前
 falser101

~/.config/JetBrains/IntelliJIdea2024.3/idea64.vmoption 配置 -Dawt.toolkit.name=WLToolkit 添加了这行,使用 xwayland 时输入法可用

--add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED
--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
-Xmx4096m
-Dide.managed.by.toolbox=/home/falser/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox
-Dsun.java2d.uiScale.enabled=true
-Dtoolbox.notification.token=1f048724-9f7a-4a09-8c0c-df9d44ad8fda
-Dtoolbox.notification.portFile=/home/falser/.cache/JetBrains/Toolbox/ports/d3924f5b-a107-45fc-be02-dd3ccead9373.port
-Dawt.toolkit.name=WLToolkit 

hyprctl clients,可以看到是运行到 wayland 下了

Window 5fcf54171d60 -> tongpulsar_console – ~/.config/JetBrains/IntelliJIdea2024.3/idea64.vmoptions:
	mapped: 1
	hidden: 0
	at: 10,47
	size: 2028,1095
	workspace: 5 (5)
	floating: 0
	pseudo: 0
	monitor: 0
	class: jetbrains-idea
	title: tongpulsar_console – ~/.config/JetBrains/IntelliJIdea2024.3/idea64.vmoptions
	initialClass: jetbrains-idea
	initialTitle: 
	pid: 83963
	xwayland: 0
	pinned: 0
	fullscreen: 0
	fullscreenClient: 0
	grouped: 0
	tags: 
	swallowing: 0
	focusHistoryID: 5
	inhibitingIdle: 0

请问下各位大佬有解决办法吗

3262 次点击
所在节点    Linux
38 条回复
phithon
242 天前
@Maboroshii 我好像没遇到过
falser101
242 天前
@cnt2ex electron 系列可以加启动参数,jetbrain 只能用 xwayland 使用才能用中文了
falser101
242 天前
@minami 每个桌面都是自己的实现,差异确实大
minami
241 天前
@falser101 #23 官方的实现 weston 更是个重量级。。。太坑了,大家宁愿用别的
yinaqu
239 天前
我记得 jetbrains 在开发 java 原生 wayland 支持,目前还没有实现 wayland 协议的 input method 协议吧?他们的进度是真的缓慢,要再等。https://youtrack.jetbrains.com/issue/JBR-5672/Wayland-support-input-methods
ztmzzz
235 天前
hyprland 下,fcitx5 可以直接用啊,安装打开默认就是 wayland 。就是有缩放的情况下候选框不会正常缩放,还是原始比例。
AlexHsu
235 天前
vscode 能用 idea 就不写注释了吧 界面需要中文的时候我都是 google 网页输入法粘贴过去
jemyzhang
233 天前
@ztmzzz #26 正在 hyprland 上面折腾输入法,terminal ( kitty)默认就可以用 fcitx5 ,wayland 窗口,但是 google-chrome 设置 ozone 为 wayland 后,非要加--enable-wayland-ime 才行,其他 electron 系也需要,但是飞书之类改装版 electron 又不读.config/electron-flags.conf ,头大的很。但是不知道为什么我另外一台电脑却没有这个问题。
现在这个有问题的电脑是新装的,archlinux + hyprland
没问题的是 archlinux+gnome ,后期改成了 hyprland ,不知道是不是 gnome 搞定了上面这些问题。

现在还有 xwayland 应用 scale 的事情,现在还搞不定。

兄弟有没有可以分享的方法不吝赐教
falser101
230 天前
@ztmzzz 看我的 idea 配置,不加-Dawt.toolkit.name=WLToolkit 是运行在 xwayland 下的,这个时候可以用输入法
falser101
230 天前
@jemyzhang 飞书我直接在启动命令后面加--enable-features=UseOzonePlatform --ozone-platform=wayland --enable-wayland-ime 这样可行,但是在 hyprland 下有问题,kde 下没问题
jemyzhang
230 天前
@falser101 #30 好吧,我也是用这种方法的,改了 hyprland exec 的命令行和 desktop 文件
falser101
229 天前
@jemyzhang 昨晚上在 hyprland 试了下飞书可以了
LuciusChen
114 天前
请问有进展么?
LuciusChen
113 天前
话说我找到解决办法了,就是 fcitx5 -r 就可以输入中文了。我在 hyprland 当中额外设置了需要的时候手动触发。fcitx5 -d -r
falser101
112 天前
@LuciusChen 你是指飞书还是 idea ,idea 改了配置了吗,是在 wayland 下运行的还是 xwayland 下运行的?
LuciusChen
112 天前
@falser101 是指 DataGrip ,DataGrip 没有改配置,原本是在 xwayland 下,但是很模糊,我就改了在 wayland 下运行。

```
Window 5577ef4e70d0 -> zj – console:
mapped: 1
hidden: 0
at: 1444,-1088
size: 712,782
workspace: 4 (4)
floating: 0
pseudo: 0
monitor: 1
class: jetbrains-datagrip
title: zj – console
initialClass: jetbrains-datagrip
initialTitle:
pid: 859
xwayland: 0
pinned: 0
fullscreen: 0
fullscreenClient: 0
grouped: 0
tags:
swallowing: 0
focusHistoryID: 1
inhibitingIdle: 0
xdgTag:
xdgDescription:
```
LuciusChen
112 天前
@falser101 不对,我一开始是加了 -Dawt.toolkit.name=WLToolkit 在 wayland 下运行,输入不了,后来去掉了,然后 fcitx5 -r 是可以在 DataGrip 输入中文的。
falser101
112 天前
@LuciusChen 还是得运行在 xwayland 下,不过可以增加 exec-once = echo 'Xft.dpi: 120' | xrdb -merge 来实现 hyprland 下所有 xwayland 应用的缩放,从而不用在应用中设置缩放

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1114355

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX