Merge branch 'wip/carlosg/fix-surrounding-text-again' into 'gtk-3-24'
imwayland: Clamp the surrounding string end correctly See merge request GNOME/gtk!1619
This commit is contained in:
commit
c67d0f0d1d
@ -322,7 +322,7 @@ notify_surrounding_text (GtkIMContextWayland *context)
|
||||
mid = MIN (context->surrounding.cursor_idx,
|
||||
context->surrounding.anchor_idx) + (cursor_len / 2);
|
||||
a = MAX (0, mid - (MAX_LEN / 2));
|
||||
b = MIN (MAX_LEN, mid + (MAX_LEN / 2));
|
||||
b = MIN (len, mid + (MAX_LEN / 2));
|
||||
|
||||
start = &context->surrounding.text[a];
|
||||
end = &context->surrounding.text[b];
|
||||
|
Loading…
Reference in New Issue
Block a user