Commit 155d5774 authored by Peng Wu's avatar Peng Wu Committed by Simon Ser
Browse files

text-input: Add preedit_commit_mode event for mouse click event

IBus update_preedit_string_with_mode feature send the preedit text and
the commit mode to the input method module, use preedit_commit_mode event
to send the commit mode together with the preeedit text.

IBusInputContext specify how input context interact with the keyboard,
but sometimes mouse click also interacts with the input context, too.

For Firefox, if some preedit text is visible with ibus-hangul input method;
after mouse click, the preedit will be committed twice.

To fix this issue, ibus-hangul can send preedit text and commit mode
together; after mouse click, the preedit is handled directly in
input method module of Firefox, and the preedit is committed in
the current text widget.

For detailed analysis, please read the merge request comments.
URL: !30

Signed-off-by: default avatarPeng Wu <>
Signed-off-by: Simon Ser's avatarSimon Ser <>
Reviewed-by: Jonas Ådahl's avatarJonas Ådahl <>
Reviewed-by: Roman Gilg's avatarRoman Gilg <>
Reviewed-by: Dorota Czaplejewicz (Purism)'s avatarDorota Czaplejewicz <>
parent ec2b62ca
Pipeline #288047 passed with stages
in 36 seconds
...@@ -417,6 +417,32 @@ ...@@ -417,6 +417,32 @@
</description> </description>
<arg name="serial" type="uint"/> <arg name="serial" type="uint"/>
</event> </event>
<enum name="commit_mode">
<description summary="focus commit mode">
Pre-edit commit mode when the focus widget or the cursor position
is changed.
<entry name="clear" value="0" summary="pre-edit text is cleared"/>
<entry name="commit" value="1" summary="pre-edit text is committed"/>
<event name="preedit_commit_mode">
<description summary="pre-edit commit mode">
Specify how the visible preedit should be handled
when switching the focus widget or changing the cursor position,
whether to commit the preedit text or clear the preedit text.
This is usually used together with the preedit_string event.
The commit behavior is the same for focus switch and
cursor position change.
The parameter mode selects the desired behavior and
its value is one from the commit mode enum.
<arg name="mode" type="uint" enum="commit_mode"/>
</interface> </interface>
<interface name="zwp_text_input_manager_v4" version="1"> <interface name="zwp_text_input_manager_v4" version="1">
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment