Merge branch 'respect-text-len-gtk4' into 'master'

imcontextwayland: Honour len argument in gtk_im_context_wayland_set_surrounding

See merge request GNOME/gtk!1529
This commit is contained in:
Emmanuele Bassi 2020-03-16 17:08:53 +00:00
commit 5bf51adcce

View File

@ -860,7 +860,7 @@ gtk_im_context_wayland_set_surrounding (GtkIMContext *context,
context_wayland = GTK_IM_CONTEXT_WAYLAND (context); context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
g_free (context_wayland->surrounding.text); g_free (context_wayland->surrounding.text);
context_wayland->surrounding.text = g_strdup (text); context_wayland->surrounding.text = g_strndup (text, len);
context_wayland->surrounding.cursor_idx = cursor_index; context_wayland->surrounding.cursor_idx = cursor_index;
/* Anchor is not exposed via the set_surrounding interface, emulating. */ /* Anchor is not exposed via the set_surrounding interface, emulating. */
context_wayland->surrounding.anchor_idx = cursor_index; context_wayland->surrounding.anchor_idx = cursor_index;