A related upstream issue which hasn't seen much traction is: https://gitlab.freedesktop.org/wayland/wayland/-/issues/273.
Yeah, looks like something we could use. I don't know what the reporter intends to do with it but I think the concerns raised in comment there is not an issue for us: we're interested in the locale information and a bit more detail to get an appropriate scan2vkey table, and we'd use the proper xkb keymap for everything else.
I haven't yet looked at the code in more detail yet (should I, or is the branch not at that point yet?)
Sure, I think it's mostly good, except for the issues you noticed. I think I would just split it, to get the most basic things first.
The behavior of composing is different compared to native Wayland apps and winex11 (native X11). In particular:
- `´ (waiting for next key)` = winex11/native wayland: `´` this: `(nothing)`
Somehow I couldn't figure how to get the temporary text out of the xkb compose state.
- `´ + π` (invalid next key) = winex11/native wayland: `´π` this: `π`
- `´ + <backspace>` = winex11/native wayland: `deletes just added ´` this: `deletes previous character`
Not sure what's the correct/expected behavior here or if it matters.
I'll need to investigate this a little bit.
Fwiw I've used the IME integration to implement the composition, because it seemed very appropriate, but I was also considering the KBDTABLES dead key support.
The IME composition has some disadvantages that it will use a popup to show the temporary text in most cases. This won't work well in wayland as the popup will appear at a random place.
The KBDTABLES deadkey support are just not supported yet, and they could probably only handle simple cases. It's also not clear if we can fill them without trying every key sequence (which may or may not be an issue?).