Skip to content

Support input method and text input

Simon Ser requested to merge github/fork/dcz-purism/input into master

Created by: dcz-purism

This change introduces basic but useful support for zwp-text-input-v3 and zwp-input-method-v2 protocols.

The compositor becomes a relay between the input method program and the user-facing text input application, passing messages between them, and gracefully handling connections and disconnections.

The text-input protocol is implemented fully. The basic and least controversial pieces to make input-method functionality complete are implemented as well. Remaining are the grab and popup functionality. What's currently implemented is enough to support virtual keyboards, but probably not enough for e.g. CJK input methods.

The structure doing most of the work is the rootston/text_input.h::roots_input_method_relay. One is attached to each seat, and each manages multiple text-input connections and zero or one input-method connections.

Testing possible using virtboard's input_method branch (at scaling factor x1) and gtk-3.24.

To test with system-wide GTK:

$WLROOTS/rootston/rootston &
$VIRTBOARD/virtboard &
yad --entry &

With locally-installed GTK, the yad line can look like this:

LD_LIBRAY_PATH=$GTK/lib yad --entry

or, in the unlikely case of issues:

GDK_BACKEND=wayland GTK_IM_MODULE=wayland GTK_IM_MODULE_FILE=$GTK/lib/gtk-3.0/3.0.0/immodules.cache yad --entry

Merge request reports