fcitx / fcitx5

maybe a new fcitx.
1.64k stars 120 forks source link

kbd-layout-viewer5 核心转储 #1122

Open knm100 opened 3 months ago

knm100 commented 3 months ago

Summary

在终端运行kbd-layout-viewer5 [knm@archlinux ~]$ kbd-layout-viewer5 qt.qpa.xcb: could not connect to display qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin. qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found. This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb, wayland-egl, wayland.

已中止(核心已转储)

Steps to Reproduce

直接在终端运行kbd-layout-viewer5 环境,Arch Linux+LXQT(wayland Session)+labwc(只有wayland,没有xwayland), 只有QT6,没有QT5安装。

Expected Behavior

正常工作

Output of fcitx5-diagnose command

这个问题应该不需要此项

wengxt commented 3 months ago

@knm100 它现在就是需要xwayland

knm100 commented 3 months ago

还需要xwayland! 那只有等完全迁移到wayland上了。 在虚拟机里,labwc的 xwayland不大好使。

aisuneko commented 3 months ago

@knm100 I'm working on a pure wayland/libxkbcommon port of kbd-layout-viewer; will upload more progress later

knm100 commented 3 months ago

Thanks, waiting for your update

wengxt commented 3 months ago

@aisuneko the issue is the geometry parsing and there's no solution to that. However, I think a reasonable workaround is to hardcode the geometry to pc105 in current xkb data. Thus, the rest can be handled by xkb common.

aisuneko commented 3 months ago

@wengxt I think it could be solved by manually looking through the xkb geometry files present on the user's machine (eg. in /usr/share/X11/xkb/geometry) for the one which matches the current keymap, and then just parse it ourselves, though it might require extensive work as the geometry file format is very complex. The remaining issue should be how to convert libxkbcommon's RMLVO interface to a KcCGST struct used in the original xkb, since I would like to reuse kbd-layout-viewer's existing code as much as possible

aisuneko commented 3 months ago

feel free to track my progress here; also it's based on https://github.com/fcitx/fcitx5-configtool/pull/79

knm100 commented 2 months ago

@aisuneko Will a PR be submitted?

aisuneko commented 2 months ago

@aisuneko Will a PR be submitted?

I'm sorry that I haven't made much progress besides laying out some groundwork for that. The xkbgeometry format is just too complex and I'm still thinking of a way to complete the task without dealing with it too much... Also I'm busy at the moment but may continue working on it if I have time to spare.

aisuneko commented 1 month ago

@wengxt I'm thinking of alternative approaches to this problem since porting the xkbgeometry parsing part to wayland is way too complex than I expected. Is it acceptable to deprecate kbd-layout-viewer5 entirely under wayland (e.g. by showing a popup to notify the user of the incompatibility before exiting immediately)? Or is there a way to statically hardcode and draw a pc105 keymap as you suggested? xkbcommon does not support geometry from the ground up, so we have to write one from scratch if we are to implement parsing from keymap files.