Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alacritty inline preedit #590

Closed
llc0930 opened this issue Aug 29, 2022 · 11 comments
Closed

alacritty inline preedit #590

llc0930 opened this issue Aug 29, 2022 · 11 comments

Comments

@llc0930
Copy link

llc0930 commented Aug 29, 2022

Describe the bug
inline preedit不顯示
alacritty/alacritty#1613 (comment)

To Reproduce
Steps to reproduce the behavior:

  1. 打開alacritty終端
  2. fcitx5-chewing輸入中文

Expected behavior
inline preedit正常顯示
alacritty/alacritty#1613 (comment)
他們說inline preedit support修復了 It seems like your IME provide its own inline input.

Desktop (please complete the following information):

  • Desktop:沒有,WM使用dwm
  • Display server type: X11
  • The output of fcitx5-diagnose if possible.
    fcitx5-diagnose.log

Additional context
我對inline preedit實在搞不清楚...他們說是IME的問題,我不確定是該在fcitx5-chewing回報還是框架這兒?

@wengxt
Copy link
Member

wengxt commented Aug 29, 2022

你的 alacritty 是什么版本?而且你给 xim 开启了 on the spot?

我这里运行 alacritty 的 cap 像是这样
IC [330e3d362f8b4392aa11502b9619677e] program:alacritty frontend:xim cap:4000000000 focus:0

而你的很奇怪,不知道为什么是 4000000012
IC [4e0d74f0c27a46eca68eb68d100c20f6] program:alacritty frontend:xim cap:4000000012 focus:1

后面的 bit 表示支持 inline preedit,而 xim 只有在使用 on the spot 才会用 preedit,而 fcitx 只有你手动设置(默认不勾选)这个选项

图片

才会对声明采用 on the spot 的 xim 程序启用 inline preedit,也就是说默认 fcitx5 无论程序是否支持,都不会对 xim 使用 inline preedit 。当然,我系统上无论这个选项怎么设置 alacritty 都不采用 inline preedit,所以我也很奇怪你的 alacritty 的版本是什么样的。

@llc0930
Copy link
Author

llc0930 commented Aug 29, 2022

我的alacritty是當前git最新版本alacritty/alacritty@18f9c27

$alacritty -V
alacritty 0.11.0-dev (18f9c27)

on the spot 是啥我搞不懂所以勾選了試試,後來重啟之後一樣不顯示,我又重置回預設值了,沒勾選,所以我需要勾選嗎?難道不是重啟fcitx5跟alacritty就夠了?

@wengxt
Copy link
Member

wengxt commented Aug 30, 2022

我测试了一下 alacritty git 的版本,果然是有问题,但 0.10.1 没有问题,不过 alacritty 处理输入法的库是靠 winit 吧,看起来是 winit 的 bug。不过我这里也没有对应处理好它不按照 xlib 的 xim 实现进行的情况。

暂时给你提供两个比较快捷解决问题的方案:
1、降级 alacritty 到稳定版本
或者
2、按 ctrl + alt + P 临时禁用来自程序的 inline preedit 提示

@wengxt
Copy link
Member

wengxt commented Aug 30, 2022

Opened a bug in winit : rust-windowing/winit#2448

@llc0930
Copy link
Author

llc0930 commented Aug 30, 2022

嗯?等等,我預期的是他應該像其他程式一樣顯示紅框的部份,所以這跟inline preedit之間的關係到底是什麼?
我的alacritty在fcitx勾選"在應用程式中顯示預編輯"項目時就是啥都不顯示但是能輸入...
2022-08-30-08:11:38-s

我降到0.10.1版後也是program:alacritty frontend:xim cap:4000000000
變回跟xterm一樣會是彈出顯示
2022-08-30-08:39:08-s

@wengxt wengxt closed this as completed in 1d69497 Aug 30, 2022
@wengxt
Copy link
Member

wengxt commented Aug 30, 2022

这里有好几个不同的问题(你可以将 inline preedit 和 on the spot style 当作一回事)
1、alacritty 使用的 toolkit 总是想要用 on the spot style (git 版本),尽管 fcitx 声明它不想支持on the spot,
2、因为 1 暴露出 fcitx5 即使不勾选使用on the spot 还是允许程序使用 on the spot,这导致了 alacritty 无法正确显示 inline preedit 的情况下 fcitx 还是使用 inline preedit。

考虑1和2的现状下,你的fcitx反正都会认为alacritty支持inline preedit并使用xim发送inline preedit,无论你勾选上面截图那个选项与否(我预期中的行为是不勾选则fcitx不对xim使用 inline preedit)。上面我的提交是为了修复2。

同时你直接关心的问题是问题3
3、alacritty 的 inline preedit 有问题,具体是什么问题我不知道,但反正没有正常把他显示出来,可能是 winit 的实现有问题,或者 alacritty 的实现有问题

@llc0930
Copy link
Author

llc0930 commented Aug 30, 2022

謝謝大佬解釋哈,雖然還是沒有很懂,
總之2修復了之後至少alacritty會像0.10.1版一樣彈出顯示輸入了什麼內容就是了吧。
嘛,3姑且再看看,反正至少讓人能知道輸入中的狀態就行...不然為了一終端老切換也挺麻煩的,
那個ctrl + alt + P的快捷我也還是來提交之前才看到有這功能,之前我都盲打...

@wengxt
Copy link
Member

wengxt commented Aug 30, 2022

2修复了之后,你还是可以通过上面显示的选项来让它使用inline preedit(简单来说,现状是你用当前的fcitx5 + alacritty git ,勾不勾那个选项都是勾的效果,我的修复是让它勾是勾的效果,不勾是不勾的效果)

@llc0930
Copy link
Author

llc0930 commented Aug 30, 2022

嗯,這點我是有看懂,其他部份我除了回報也沒啥能作的了...對輸入法沒啥研究...就看看你們討論漲漲姿勢了...

@wengxt
Copy link
Member

wengxt commented Aug 30, 2022

3的原因看起来是因为我打错了一行很久,但其他一些我用来测试实现似乎并不依赖这个行为,所以没有问题…现在可以正常显示 inline preedit 了

@llc0930
Copy link
Author

llc0930 commented Aug 30, 2022

我等發行版打包新包好了,好懶 (┐「ε:)
裝上新包了,好用,感謝大佬。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants