clients: keyboard: fix delete before cursor
When editing a text field in chromium deleting the surrounding text with
backspace fails with `The selection range for surrounding text is invalid`
It seems like `(start - keyboard->surrounding_text) - keyboard->surrounding_cursor` evaluates to -1.
As far as i can tell `start - keyboard->surrounding_text` evaluates to
the index in the surrounding_text char arrays that should be deleted.
Signed-off-by: Aske Bækdal Møller <aske@geanix.com>
(cherry picked from commit 33ec3898d0
)
This commit is contained in:
parent
6f26c009c1
commit
7e1115479b
|
@ -506,7 +506,7 @@ delete_before_cursor(struct virtual_keyboard *keyboard)
|
|||
end = keyboard->surrounding_text + keyboard->surrounding_cursor;
|
||||
|
||||
zwp_input_method_context_v1_delete_surrounding_text(keyboard->context,
|
||||
(start - keyboard->surrounding_text) - keyboard->surrounding_cursor,
|
||||
start - keyboard->surrounding_text,
|
||||
end - start);
|
||||
zwp_input_method_context_v1_commit_string(keyboard->context,
|
||||
keyboard->serial,
|
||||
|
|
Loading…
Reference in New Issue