mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
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
(Cherry-picked from commit 3b6f9111c7
)
This commit is contained in:
parent
4ccdedfd99
commit
42d6013bc5
@ -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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user