[gtk/gtk-3-24: 1/2] imwayland: clear preedit on focus out
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gtk-3-24: 1/2] imwayland: clear preedit on focus out
- Date: Sun, 26 Aug 2018 23:48:43 +0000 (UTC)
commit 49b17e6c1e853e81e2087a989524d8e0cad08d05
Author: Dorota Czaplejewicz <dorota czaplejewicz puri sm>
Date: Thu Aug 23 12:32:11 2018 +0200
imwayland: clear preedit on focus out
modules/input/imwayland.c | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
---
diff --git a/modules/input/imwayland.c b/modules/input/imwayland.c
index 3589c4c130..11d09d2007 100644
--- a/modules/input/imwayland.c
+++ b/modules/input/imwayland.c
@@ -135,18 +135,7 @@ static void
text_input_leave (void *data,
struct zwp_text_input_v3 *text_input,
struct wl_surface *surface)
-{
- /*
- GtkIMContextWayland *context;
-
- if (!global->current)
- return;
-
- context = GTK_IM_CONTEXT_WAYLAND (global->current);
- TODO: does this clear text input or modify text?
- reset_preedit (context);
- */
-}
+{}
static void
text_input_preedit (void *data,
@@ -169,7 +158,6 @@ text_input_preedit (void *data,
context->pending_preedit.cursor_end = cursor_end;
}
-
static void
text_input_preedit_apply (GtkIMContextWaylandGlobal *global)
{
@@ -664,6 +652,11 @@ gtk_im_context_wayland_focus_out (GtkIMContext *context)
zwp_text_input_v3_disable (global->text_input);
commit_state (context_wayland);
+
+ /* after disable, incoming state changes won't take effect anyway */
+ text_input_preedit (global, global->text_input, "", 0, 0);
+ text_input_preedit_apply (global);
+
global->current = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]