Skip to content

Add gtk_im_context_forward_key to forward keys from input method

Takao Fujiwara requested to merge fujiwarat/gtk:gdkevent-set-ibus-flag into master

IBus IM module needs to forward key events from input method engines but now GdkEvent is an object and its properties cannot be modified. IBus IM module had added a IBUS_HANDLED_MASK mask to state of GdkEventKey in GTK3 to avoid an infinite loop of the events and now the IBus module adds GDK_EVENT_INPUT_METHOD to flags in GdkEventKey with gtk_im_context_forward_key() in GTK4 for the purpose.

IBus IM module had used gdk_event_put() with IBUS_IGNORED_MASK in state of GdkEventKey in GTK3 for processed key events from the async filter_keypress and now the IBus module uses gtk_im_context_put_key_event() with the GDK_EVENT_INPUT_METHOD flags in GTK4 for the purpose.

The similar way was also implemented in Mutter ClutterInputMethod.

Fix #1208 (closed)

Edited by Takao Fujiwara

Merge request reports