Riey / kime

Korean IME
GNU General Public License v3.0
523 stars 53 forks source link

Add Wayland zwp_input_method_v1 support #659

Closed Jhyub closed 7 months ago

Jhyub commented 11 months ago

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

Checklist

black7375 commented 10 months ago

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

image image image

OctopusET commented 10 months ago

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
Jhyub commented 10 months ago

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

OctopusET commented 10 months ago

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 commented 10 months ago

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

Jhyub commented 10 months ago

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

Jhyub commented 10 months ago

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)

OctopusET commented 10 months ago

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.

Jhyub commented 10 months ago

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.