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

Arch Linux, hibernate 成功, 然后然后唤醒后, fcitx5 在 wezterm 中切换中文失效 #1030

Closed
zw963 opened this issue Apr 26, 2024 · 9 comments

Comments

@zw963
Copy link

zw963 commented Apr 26, 2024

Describe the bug
请看 这个 issue.

虽然, 我不认为这是 fcitx 5 的问题 (因为这个问题只发生在 wezterm 上面), 而且, 现在只要 hibernate 然后重启, 一定稳定重现.

参照评论中说的, 设定在在窗口间共享状态为所有, 也无法解决. (见截图)


下面是具体的问题描述:

我使用的 minipc (没有电池), 为了避免关机数据丢失, 我通常会 hibernate.

但是从 hibernate 重新启动后, 如果尝试在已经打开的 wezterm 窗口上面切换输入法, 在 wezterm 上面, 能看到提示 "简" 出来, 但是实际上只能输入英文, 任务栏小标题也显示仍旧还是英文. 但是 fcitx5 在其他 app, 例如: firefox, telegram 上, 工作得好好的.

解决办法为: 关闭所有的 wezterm 窗口, 完全退出 wezterm 进程, 并重新启动 wezterm.

当前 wezterm 唯一跟 im 有关配置是:

config.xim_im_name = 'fcitx'

Desktop (please complete the following information):

  • Desktop: GNOME
  • Display server type: Wayland
  • The output of fcitx5-diagnose if possible.

谢谢!

@wengxt
Copy link
Member

wengxt commented Apr 26, 2024

我推测多半是 gnome 的 text input v3 实现的问题,fcitx 根本没有任何和待机相关的逻辑。

你可以 WAYLAND_DEBUG=1 wezterm 看看

@wengxt wengxt closed this as completed Apr 26, 2024
@zw963
Copy link
Author

zw963 commented May 6, 2024

Hi, following is the log i captured when run with WAYLAND_DEUG=1 wezterm, then hibernate, then boot into my arch linux, i am pressing Ctrl + Space twice, please check if help for discover the bug.

log switch IM not work after boot from hibernate
[2232932.322]  -> [email protected](new id wl_callback@34)
[2232932.329]  -> [email protected](wl_buffer@25, 0, 0)
[2232932.333]  -> [email protected](0, 0, 2147483647, 2147483647)
[2232932.336]  -> [email protected]()
[2232947.542] [email protected]_id(27)
[2232947.561] [email protected]_id(34)
[2232947.564] [email protected](4818990)
[2233457.607] [email protected](9612, 4819499, 57, 0)
[2233457.674]  -> [email protected](new id wl_callback@27)
[2233457.822] [email protected]()
[2233457.827] [email protected](4818990)
[2233457.990]  -> [email protected](new id wl_callback@34)
[2233457.999]  -> [email protected](wl_buffer@28, 0, 0)
[2233458.003]  -> [email protected](0, 0, 2147483647, 2147483647)
[2233458.007]  -> [email protected]()
[2233463.869] [email protected]_id(27)
[2233463.880] [email protected]_id(34)
[2233463.883] [email protected](4819506)
[2233553.657] [email protected](9613, 4819595, 29, 0)
[2233553.675] [email protected](9614, 0, 0, 0, 0)
[2233554.846]  -> [email protected](new id wl_callback@27)
[2233554.952] [email protected]()
[2233554.957] [email protected](4819506)
[2233555.105]  -> [email protected](new id wl_callback@34)
[2233555.112]  -> [email protected](wl_buffer@25, 0, 0)
[2233555.115]  -> [email protected](0, 0, 2147483647, 2147483647)
[2233555.118]  -> [email protected]()
[2233563.840] [email protected]_id(27)
[2233563.852] [email protected]_id(34)
[2233563.855] [email protected](4819606)
[2235977.860] [email protected](9615, 4822019, 29, 1)
[2235977.878] [email protected](9616, 4, 0, 0, 0)
[2235979.265]  -> [email protected](new id wl_callback@27)
[2235979.387] [email protected]()
[2235979.392] [email protected](4819606)
[2235979.559]  -> [email protected](new id wl_callback@34)
[2235979.567]  -> [email protected](wl_buffer@28, 0, 0)
[2235979.570]  -> [email protected](0, 0, 2147483647, 2147483647)
[2235979.573]  -> [email protected]()
[2235980.765] [email protected]_id(27)
[2235980.775] [email protected]_id(34)
[2235980.778] [email protected](4822023)
[2236249.781] [email protected](9617, 4822291, 57, 0)
[2236249.848]  -> [email protected](new id wl_callback@27)
[2236249.999] [email protected]()
[2236250.004] [email protected](4822023)
[2236250.161]  -> [email protected](new id wl_callback@34)
[2236250.171]  -> [email protected](wl_buffer@25, 0, 0)
[2236250.175]  -> [email protected](0, 0, 2147483647, 2147483647)
[2236250.178]  -> [email protected]()
[2236264.379] [email protected]_id(27)
[2236264.415] [email protected]_id(34)
[2236264.418] [email protected](4822306)
[2236298.340] [email protected](9618, 4822339, 29, 0)
[2236298.357] [email protected](9619, 0, 0, 0, 0)
[2236299.496]  -> [email protected](new id wl_callback@27)
[2236299.598] [email protected]()
[2236299.602] [email protected](4822306)
[2236299.735]  -> [email protected](new id wl_callback@34)
[2236299.742]  -> [email protected](wl_buffer@28, 0, 0)
[2236299.745]  -> [email protected](0, 0, 2147483647, 2147483647)
[2236299.748]  -> [email protected]()
[2236314.330] [email protected]_id(27)
[2236314.365] [email protected]_id(34)
[2236314.368] [email protected](4822356)
[2238450.027] [email protected](9620, 4824491, 56, 1)
[2238450.045] [email protected](9621, 4104, 0, 0, 0)
[2238451.480]  -> [email protected](new id wl_callback@27)
[2238451.604] [email protected]()
[2238451.608] [email protected](4822356)
[2238451.776]  -> [email protected](new id wl_callback@34)
[2238451.784]  -> [email protected](wl_buffer@25, 0, 0)
[2238451.787]  -> [email protected](0, 0, 2147483647, 2147483647)
[2238451.790]  -> [email protected]()
[2238465.093] [email protected]_id(27)
[2238465.129] [email protected]_id(34)
[2238465.132] [email protected](4824507)
[2238526.863] [email protected](9623, wl_surface@21)
[2238526.885] [email protected](wl_surface@21)
[2238526.903]  -> [email protected]()
[2238526.909]  -> [email protected]()
[2238528.258]  -> [email protected](new id wl_callback@27)
[2238528.436] [email protected]()
[2238528.441] [email protected](4824507)
[2238528.620]  -> [email protected](new id wl_callback@34)
[2238528.629]  -> [email protected](wl_buffer@28, 0, 0)
[2238528.633]  -> [email protected](0, 0, 2147483647, 2147483647)
[2238528.635]  -> [email protected]()
[2238528.676]  -> [email protected]_cursor_rectangle(96, 197, 15, 39)
[2238528.680]  -> [email protected]()
[2238534.814] [email protected]_id(27)
[2238534.840] [email protected]_id(34)
[2238534.844] [email protected](4824577)
[2238637.454] [email protected]_bounds(3840, 2061)
[2238637.490] [email protected](1220, 946, array[0])
[2238637.497] [email protected](587)
[2238637.515]  -> [email protected]_configure(587)
[2238637.544]  -> [email protected]_window_geometry(0, 0, 1220, 946)
[2238637.552]  -> [email protected]()
[2238637.559]  -> [email protected](new id wl_callback@27)
[2238637.716] [email protected]()
[2238637.721] [email protected](4824577)
[2238637.863]  -> [email protected](new id wl_callback@34)
[2238637.869]  -> [email protected](wl_buffer@25, 0, 0)
[2238637.873]  -> [email protected](0, 0, 2147483647, 2147483647)
[2238637.879]  -> [email protected]()
[2238648.377] [email protected]_id(27)
[2238648.399] [email protected]_id(34)
[2238648.404] [email protected](4824690)

Following is log is after reload fcitx5 config use pressing mouse right button on the system tray icon, fcitx start to working on wezterm. only Ctrl + Space once.

logs reload fcitx config make it work with wezterm
2724074.718]  -> [email protected](new id wl_callback@34)
[2724074.725]  -> [email protected](wl_buffer@28, 0, 0)
[2724074.729]  -> [email protected](0, 0, 2147483647, 2147483647)
[2724074.732]  -> [email protected]()
[2724077.941] [email protected]_id(27)
[2724077.951] [email protected]_id(34)
[2724077.953] [email protected](5310943)
[2724422.923] [email protected](12438, 5311287, 57, 0)
[2724423.023]  -> [email protected](new id wl_callback@27)
[2724423.365] [email protected]()
[2724423.371] [email protected](5310943)
[2724423.623]  -> [email protected](new id wl_callback@34)
[2724423.634]  -> [email protected](wl_buffer@25, 0, 0)
[2724423.638]  -> [email protected](0, 0, 2147483647, 2147483647)
[2724423.645]  -> [email protected]()
[2724427.095] [email protected]_id(27)
[2724427.102] [email protected]_id(34)
[2724427.104] [email protected](5311292)
[2724530.459] [email protected](12439, 5311390, 29, 0)
[2724530.493] [email protected](12440, 0, 0, 0, 0)
[2724533.509]  -> [email protected](new id wl_callback@27)
[2724533.668] [email protected]()
[2724533.672] [email protected](5311292)
[2724533.810]  -> [email protected](new id wl_callback@34)
[2724533.817]  -> [email protected](wl_buffer@28, 0, 0)
[2724533.820]  -> [email protected](0, 0, 2147483647, 2147483647)
[2724533.823]  -> [email protected]()
[2724536.420] [email protected]_id(27)
[2724536.429] [email protected]_id(34)
[2724536.432] [email protected](5311401)
[2728407.614] [email protected](12441, 5315271, 56, 1)
[2728407.643] [email protected](12442, 4104, 0, 0, 0)
[2728410.548]  -> [email protected](new id wl_callback@27)
[2728410.794] [email protected]()
[2728410.800] [email protected](5311401)
[2728411.036]  -> [email protected](new id wl_callback@34)
[2728411.041]  -> [email protected](wl_buffer@25, 0, 0)
[2728411.046]  -> [email protected](0, 0, 2147483647, 2147483647)
[2728411.050]  -> [email protected]()
[2728414.751] [email protected]_id(27)
[2728414.761] [email protected]_id(34)
[2728414.766] [email protected](5315279)
[2728430.377] [email protected](12444, wl_surface@21)
[2728430.393] [email protected](wl_surface@21)
[2728430.410]  -> [email protected]()
[2728430.416]  -> [email protected]()
[2728433.008]  -> [email protected](new id wl_callback@27)
[2728433.225] [email protected]()
[2728433.230] [email protected](5315279)
[2728433.347]  -> [email protected](new id wl_callback@34)
[2728433.352]  -> [email protected](wl_buffer@28, 0, 0)
[2728433.355]  -> [email protected](0, 0, 2147483647, 2147483647)
[2728433.357]  -> [email protected]()
[2728433.392]  -> [email protected]_cursor_rectangle(96, 158, 15, 39)
[2728433.396]  -> [email protected]()
[2728437.408] [email protected]_id(27)
[2728437.417] [email protected]_id(34)
[2728437.420] [email protected](5315302)
[2728547.288] [email protected]_bounds(3840, 2061)
[2728547.321] [email protected](1220, 946, array[0])
[2728547.330] [email protected](688)
[2728547.361]  -> [email protected]_configure(688)
[2728547.405]  -> [email protected]_window_geometry(0, 0, 1220, 946)
[2728547.414]  -> [email protected]()
[2728547.426]  -> [email protected](new id wl_callback@27)
[2728547.827] [email protected]()
[2728547.832] [email protected](5315302)
[2728547.951]  -> [email protected](new id wl_callback@34)
[2728547.957]  -> [email protected](wl_buffer@25, 0, 0)
[2728547.962]  -> [email protected](0, 0, 2147483647, 2147483647)
[2728547.966]  -> [email protected]()
[2728553.960] [email protected]_id(27)
[2728553.964] [email protected]_id(34)
[2728553.966] [email protected](5315419)

Thanks

@zw963
Copy link
Author

zw963 commented May 13, 2024

Hi, @wengxt , 我又测试了好一阵子了, 我发现, 每次从 hibernate wakeup 之后无法使用 fcitx 切换到中文时, 只需要在托盘点击右键,选择 reload configuration, 中文输入法在 wezterm 就又可以工作了.

我倒是知道在哪里加 hook 来确保在唤醒后自动运行某个脚本, 请教下, 如何在命令行下面执行 reload configuration 呢?

谢谢.

@wengxt
Copy link
Member

wengxt commented May 13, 2024

@zw963 fcitx5根本就没有那个菜单项目,你确定你在用fcitx5?

@wengxt
Copy link
Member

wengxt commented May 13, 2024

哦,如果你是 gnome 的話,可能是 gnome-shell 的 text-input-v3 的 bug

点开菜单我认为并没有用,把焦点从 wezterm 移开才是有用的那个。

可能有关的:https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5863

不过我建议你自己单独开一个,我猜锁屏可能就能触发

你可以在后台运行一个

watch -n 2 dbus-send --print-reply=literal --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.DebugInfo

观察 focus:1 的那一行的变化

@zw963
Copy link
Author

zw963 commented May 14, 2024

Want to try as you suggested, so, run pacman -Syu first, but fcitx 5 get broken. check #1052

@wengxt
Copy link
Member

wengxt commented May 14, 2024

@zw963 did you fully Syu ed?

@zw963
Copy link
Author

zw963 commented May 14, 2024

watch -n 2 dbus-send --print-reply=literal --dest=org.fcitx.Fcitx5 /controller org.fcitx.Fcitx.Controller1.DebugInfo

正如你说的那样, suspend 也会触发这个问题.

在 suspend 之前, 我运行上面的命令之后, 输出似乎是静止的. (可能 2s 刷新一次, 但是, 内容是一样的)

suspend 之后, 再唤醒, 输入法在 wezterm 下失效, 失效后的输出也是静止的, 这是输出.

Every 2.0s: dbus-send --print-reply=literal --dest=org.fcitx.Fcitx5 /controller org.fcit...  mingfan: Tue May 14 11:56:12 2024

   Group [wayland:] has 9 InputContext(s)
  IC [c76e9f2d35974ebb9d4e9a3eb874c68d] program: frontend:ibus cap:5a focus:1
  IC [9544b1af99ac4d3a9e0214e6f916039a] program:emacs frontend:dbus cap:6001000072 focus:0
  IC [ad503cddc3b04764b1490a7b20433a62] program:telegram-desktop frontend:dbus cap:16001800072 focus:0
  IC [efd1662118ef4bd0badaf6cd9db99658] program:firefox frontend:dbus cap:6001000072 focus:0
  IC [508a3131956d4aed87e59d07494e974e] program:firefox frontend:dbus cap:6001000032 focus:0
  IC [0ac656be35854f2e857bb03cf41e47ea] program:firefox frontend:dbus cap:6001000032 focus:0
  IC [81a492a8492a4a4c8564dc692f25fbb0] program:firefox frontend:dbus cap:6001000032 focus:0
  IC [1cff62e6f24e435890184a58e4ead2aa] program:firefox frontend:dbus cap:6001000032 focus:0
  IC [1f9e0965fe1349ab8d91163d4e208e84] program:firefox frontend:dbus cap:6001000032 focus:0
Group [x11::0] has 2 InputContext(s)
  IC [93db6852ec534f5d99e5467d2813140a] program:copyq frontend:dbus cap:16000800072 focus:0
  IC [7c8f3654b0834a4fa79115319bfe1391] program:qq frontend:dbus cap:6000000032 focus:0
Input Context without group

@zw963
Copy link
Author

zw963 commented May 14, 2024

@zw963 did you fully Syu ed?

 ╰─ $ pacman -Syu
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 multilib is up to date
 archlinuxcn is up to date
 aur-repo is up to date
:: Starting full system upgrade...
 there is nothing to do

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