kime icon indicating copy to clipboard operation
kime copied to clipboard

Add Wayland zwp_input_method_v1 support

Open Jhyub opened this issue 1 year ago • 9 comments

Summary

This PR introduces support for Wayland zwp_input_method_v1.
This enables IME input with non-GTK/QT wayland software under certain compositors such as KWin Wayland. The PR also introduces minor changes in desktop files to make kime functional under KDE Plasma Wayland.

Note

  • This PR closes #604 #638
  • This PR has been tested under my environment: Arch Linux, kwin 5.27.10 (kwin_wayland)

Checklist

  • [ ] I have documented my changes properly to adequate places
  • [x] I have updated the docs/CHANGELOG.md

Jhyub avatar Dec 26 '23 16:12 Jhyub

I've confirmed that KIME works in Plasma Wayland session. (Plasma Wayland 세션에서 KIME가 동작함을 확인하였습니다.)

image image image

black7375 avatar Jan 06 '24 12:01 black7375

It works with Weston 13.0.0

To use kime on weston, you need to add this to weston.ini

[input-method]
path=/usr/bin/kime

OctopusET avatar Jan 07 '24 15:01 OctopusET

I did not implement kime-check for weston because it seems to be impossible to find out if kime is running under weston.

Jhyub avatar Jan 08 '24 02:01 Jhyub

It's pretty messed up, but there is a way to get the compositor name without using theXDG_CURRENT_DESKTOP env.

https://stackoverflow.com/questions/69302630/wayland-client-get-compositor-name

OctopusET avatar Jan 08 '24 04:01 OctopusET

And even in sway, there's no guarantee sway session always have the XDG_CURRENT_DESKTOP env. https://github.com/swaywm/sway/pull/4876

OctopusET avatar Jan 08 '24 04:01 OctopusET

It seems better not to unwrap env::var("XDG_CURRENT_DESKTOP") then...

Jhyub avatar Jan 08 '24 05:01 Jhyub

It's pretty messed up, but there is a way to get the compositor name without using theXDG_CURRENT_DESKTOP env.

https://stackoverflow.com/questions/69302630/wayland-client-get-compositor-name

This method seems a little bit too hacky to use... maybe it might be better to detect if weston is installed? (such as if /usr/share/weston exists)

Jhyub avatar Jan 08 '24 05:01 Jhyub

IMHO, I don't think it's the IME's job to check if it works or not. And yeah, that solution is really hacky way, I guess if you really want to add some checker for the Weston. Checking software like neofetch would be a good way to find the way to get a compositor's name.

OctopusET avatar Jan 08 '24 12:01 OctopusET

Since that would result in adding another dependency, and considering that weston doesn't seem to have many real-world use cases (if I understood its project goals correctly) it seems more reasonable to me as well not to implement kime-check for it.

Jhyub avatar Jan 08 '24 14:01 Jhyub