Despite the fact the sway is the one of the most used wayland compositor, it currently lacks the implementation of keyboard grab feature of input-method-unstable-v2 protocol. A PR for this issue, swaywm/sway#4932 was submitted but it's not merged due to several bugs. We must fix the bugs and support input methods to the sway.
First you must install sway 1.5.1, wlroots 0.12.0 and setup the Korean IME with input-method-unstable-v2 support. There bugs are reproducible with kime and fcitx5.
1. Key repeat bug → Bug of both kime and fcitx5, fixed in kime
This bug is not related with key repeat feature of IME. For example, this bug is reproducible with IMEs which lacks the key repeat feature like old version of kime without or wlhangul. Sway's input-method-unstable-v2 implementation of wlroots is the suspected cause.
Error reproduction steps 1: Hold Alt for 3 seconds → Press 1 → Immediately release Alt and 1
Expected behavior: Alt + 1 is typed once
Actual behavior: 1 is typed infinitely
Error reproduction steps 2: Hold Ctrl for 3 seconds → Press Tab → Immediately release Ctrl and Tab
Expected behavior: Ctrl + Tab is typed once
Actual behavior: Tab is typed infinitely
Error reproduction steps 2: Hold a for 3 seconds → Press b → Immediately release a and b
Expected behavior: Repeat of a stops as soon as user release a and b
Actual behavior: b is typed infinitely
2. Focus change bug
I think it's caused by the timing of wlroots' deactivate, done event. But not sure though.
sway는 굉장히 메이저하게 쓰이는 wayland compositier중 하나임에도, 다국어입력기 사용을 위해 필수적인 keyboard grab 프로토콜이 아직 구현되어있지 않았습니다. 이를 위한 PR인 swaywm/sway#4932가 현재 submit된 상태인데, 버그가 있어 아직 머지되지 못하고있습니다. swaywm/sway#4932의 버그를 마저 고치고, sway에 다국어 지원을 넣어야만 합니다.
이 키 반복 버그 자체는 IME의 키 반복 기능과는 상관없이 발생합니다. 예를들어 키 반복기능이 없는 구버전 kime나 wlhangul을 사용해도 재현이 가능하기 때문입니다. sway의 input-method-unstable-v2 구현이나 wlroots 구현 문제인것으로 생각됩니다.
재현 방법 1: Alt 누름 → 3초 유지 → 1 누름 → 즉시 Alt, 1 동시에 뗌
원하는 동작: Alt + 1이 1회 입력됨
실제 동작: 1이 무한으로 입력됨
재현 방법 2: Ctrl 누름 → 3초 유지 → Tab 누름 → 즉시 Ctrl, Tab 동시에 뗌
Environment
Summary
Despite the fact the sway is the one of the most used wayland compositor, it currently lacks the implementation of keyboard grab feature of input-method-unstable-v2 protocol. A PR for this issue, swaywm/sway#4932 was submitted but it's not merged due to several bugs. We must fix the bugs and support input methods to the sway.
This is the build of sway with swaywm/sway#4932 being merged.
Current bugs
First you must install sway 1.5.1, wlroots 0.12.0 and setup the Korean IME with input-method-unstable-v2 support. There bugs are reproducible with kime and fcitx5.
1.
Key repeat bug→ Bug of both kime and fcitx5, fixed in kimeThis bug is not related with key repeat feature of IME. For example, this bug is reproducible with IMEs which lacks the key repeat feature like old version of kime without or wlhangul. Sway's input-method-unstable-v2 implementation of wlroots is the suspected cause.2. Focus change bug
I think it's caused by the timing of wlroots' deactivate, done event. But not sure though.
Update: This bug in inevitable with input-method-unstable-v2 protocol. See https://github.com/swaywm/sway/pull/4932#issuecomment-774113129. Only possible workaround is to discard preedit strings on deactivate event.
References
(korean translation)
환경
요약
sway는 굉장히 메이저하게 쓰이는 wayland compositier중 하나임에도, 다국어입력기 사용을 위해 필수적인 keyboard grab 프로토콜이 아직 구현되어있지 않았습니다. 이를 위한 PR인 swaywm/sway#4932가 현재 submit된 상태인데, 버그가 있어 아직 머지되지 못하고있습니다. swaywm/sway#4932의 버그를 마저 고치고, sway에 다국어 지원을 넣어야만 합니다.
swaywm/sway#4932가 머지된 버전의 sway는 여기에서 받아볼 수 있습니다.
현재 버그
먼저 sway 1.5.1, wlroots 0.12.0를 설치한 뒤, input-method-unstable-v2 프로토콜을 지원하는 한글 입력기를 설치한다. kime와 fcitx5 에서 재현 가능하다.
1.
키 반복 버그→ kime와 fcitx5의 버그였음, kime에선 고쳐짐이 키 반복 버그 자체는 IME의 키 반복 기능과는 상관없이 발생합니다. 예를들어 키 반복기능이 없는 구버전 kime나 wlhangul을 사용해도 재현이 가능하기 때문입니다. sway의 input-method-unstable-v2 구현이나 wlroots 구현 문제인것으로 생각됩니다.2. 포커스 변환 버그
wlroots가 IME에 deactivate, done 이벤트를 주는 타이밍의 문제인것으로 생각되는데, 확실치는 않습니다.
업데이트: 이 버그는 input-method-unstable-v2 프로토콜을 쓰는 이상 피할 수 없다. https://github.com/swaywm/sway/pull/4932#issuecomment-774113129 참고. 유일한 우회책은 deactivate event가 들어오면 preedit 문자열을 버리는 것이다.
참고자료
CC @guswns0528