summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtk/gtktextview.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index c3289a0ce8..5b8bca680a 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -504,8 +504,10 @@ static void gtk_text_view_commit_handler (GtkIMContext *conte
GtkTextView *text_view);
static void gtk_text_view_commit_text (GtkTextView *text_view,
const char *text);
+static void gtk_text_view_preedit_start_handler (GtkIMContext *context,
+ GtkTextView *text_view);
static void gtk_text_view_preedit_changed_handler (GtkIMContext *context,
- GtkTextView *text_view);
+ GtkTextView *text_view);
static gboolean gtk_text_view_retrieve_surrounding_handler (GtkIMContext *context,
GtkTextView *text_view);
static gboolean gtk_text_view_delete_surrounding_handler (GtkIMContext *context,
@@ -1883,6 +1885,8 @@ gtk_text_view_init (GtkTextView *text_view)
g_signal_connect (priv->im_context, "commit",
G_CALLBACK (gtk_text_view_commit_handler), text_view);
+ g_signal_connect (priv->im_context, "preedit-start",
+ G_CALLBACK (gtk_text_view_preedit_start_handler), text_view);
g_signal_connect (priv->im_context, "preedit-changed",
G_CALLBACK (gtk_text_view_preedit_changed_handler), text_view);
g_signal_connect (priv->im_context, "retrieve-surrounding",
@@ -8213,6 +8217,13 @@ gtk_text_view_commit_text (GtkTextView *text_view,
}
static void
+gtk_text_view_preedit_start_handler (GtkIMContext *context,
+ GtkTextView *self)
+{
+ gtk_text_buffer_delete_selection (self->priv->buffer, TRUE, self->priv->editable);
+}
+
+static void
gtk_text_view_preedit_changed_handler (GtkIMContext *context,
GtkTextView *text_view)
{