[mutter/wip/carlosg/text-input-preedit-reset] clutter: Only reset preedit text if set
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/text-input-preedit-reset] clutter: Only reset preedit text if set
- Date: Tue, 19 Oct 2021 17:22:11 +0000 (UTC)
commit f71011f6e50eb679171540bf59130d68d98d4906
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Oct 19 16:53:13 2021 +0200
clutter: Only reset preedit text if set
On ClutterInputFocus::reset, avoid to unset the preedit text if
none was set earlier. This seems to trick GTK clients into focusing
the cursor position again, even when we are moving away from it.
Fixes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/4647
clutter/clutter/clutter-input-focus.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter/clutter-input-focus.c b/clutter/clutter/clutter-input-focus.c
index c22e3a32c0..117bab72ce 100644
--- a/clutter/clutter/clutter-input-focus.c
+++ b/clutter/clutter/clutter-input-focus.c
@@ -103,14 +103,16 @@ clutter_input_focus_reset (ClutterInputFocus *focus)
priv = clutter_input_focus_get_instance_private (focus);
- if (priv->preedit &&
- priv->mode == CLUTTER_PREEDIT_RESET_COMMIT)
- clutter_input_focus_commit (focus, priv->preedit);
+ if (priv->preedit)
+ {
+ if (priv->mode == CLUTTER_PREEDIT_RESET_COMMIT)
+ clutter_input_focus_commit (focus, priv->preedit);
- clutter_input_focus_set_preedit_text (focus, NULL, 0);
- g_clear_pointer (&priv->preedit, g_free);
- priv->mode = CLUTTER_PREEDIT_RESET_CLEAR;
+ clutter_input_focus_set_preedit_text (focus, NULL, 0);
+ g_clear_pointer (&priv->preedit, g_free);
+ }
+ priv->mode = CLUTTER_PREEDIT_RESET_CLEAR;
clutter_input_method_reset (priv->im);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]