Always emit reset for IM preedit with mouse click

Hangul inputs treat pre-edit text as output text and the pre-edit
text won't be moved with mouse click.
Now the reset signal is always emitted simply with mouse click and
each IM engine could handle the signal whether the preedit is committed,
cleared or kept.

Closes #1534
This commit is contained in:
Takao Fujiwara 2019-02-20 18:58:51 +09:00
parent 02e856f62e
commit 4b2e4f6628
2 changed files with 8 additions and 3 deletions

View File

@ -2518,7 +2518,8 @@ gtk_text_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
gtk_widget_get_modifier_mask (widget,
GDK_MODIFIER_INTENT_EXTEND_SELECTION));
if (extend_selection)
/* Always emit reset when preedit is shown */
priv->need_im_reset = TRUE;
gtk_text_reset_im_context (self);
switch (n_press)

View File

@ -5103,7 +5103,11 @@ gtk_text_view_multipress_gesture_pressed (GtkGestureMultiPress *gesture,
gdk_device_get_source (device) == GDK_SOURCE_TOUCHSCREEN;
if (n_press == 1)
{
/* Always emit reset when preedit is shown */
priv->need_im_reset = TRUE;
gtk_text_view_reset_im_context (text_view);
}
if (n_press == 1 &&
gdk_event_triggers_context_menu (event))