mirror of
https://github.com/brl/mutter.git
synced 2025-02-17 21:54:10 +00:00
wayland: Handle NULL preedit text
The preedit text may be NULL (eg. when unsetting it). This started causing crashes since commit db9b60cc635, duh. Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1132
This commit is contained in:
parent
7fa7c2aeb7
commit
8592a8591b
@ -207,9 +207,11 @@ meta_wayland_text_input_focus_set_preedit_text (ClutterInputFocus *focus,
|
|||||||
{
|
{
|
||||||
MetaWaylandTextInput *text_input;
|
MetaWaylandTextInput *text_input;
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
gsize pos;
|
gsize pos = 0;
|
||||||
|
|
||||||
text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
|
text_input = META_WAYLAND_TEXT_INPUT_FOCUS (focus)->text_input;
|
||||||
|
|
||||||
|
if (text)
|
||||||
pos = g_utf8_offset_to_pointer (text, cursor) - text;
|
pos = g_utf8_offset_to_pointer (text, cursor) - text;
|
||||||
|
|
||||||
wl_resource_for_each (resource, &text_input->focus_resource_list)
|
wl_resource_for_each (resource, &text_input->focus_resource_list)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user