From ab16861e8670c9d80a6188e7d878bb095c9b56ad Mon Sep 17 00:00:00 2001 From: Isaac Freund Date: Sun, 7 Nov 2021 20:14:18 +0100 Subject: [PATCH] text-input: fix type of send_preedit_string() args The protocol uses a signed integer here, which is also what the wlr_input_method_v2_preedit_string struct provides to compositors from the input method protocol. Sway currently just passes those int32_t values directly to this function leading to an implicit conversion. --- include/wlr/types/wlr_text_input_v3.h | 2 +- types/wlr_text_input_v3.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/wlr/types/wlr_text_input_v3.h b/include/wlr/types/wlr_text_input_v3.h index 53c52a37..c9ee0b22 100644 --- a/include/wlr/types/wlr_text_input_v3.h +++ b/include/wlr/types/wlr_text_input_v3.h @@ -87,7 +87,7 @@ void wlr_text_input_v3_send_enter(struct wlr_text_input_v3 *text_input, // Sends leave to the currently focused surface and clears it void wlr_text_input_v3_send_leave(struct wlr_text_input_v3 *text_input); void wlr_text_input_v3_send_preedit_string(struct wlr_text_input_v3 *text_input, - const char *text, uint32_t cursor_begin, uint32_t cursor_end); + const char *text, int32_t cursor_begin, int32_t cursor_end); void wlr_text_input_v3_send_commit_string(struct wlr_text_input_v3 *text_input, const char *text); void wlr_text_input_v3_send_delete_surrounding_text( diff --git a/types/wlr_text_input_v3.c b/types/wlr_text_input_v3.c index 9a4c42c9..f5267b35 100644 --- a/types/wlr_text_input_v3.c +++ b/types/wlr_text_input_v3.c @@ -42,7 +42,7 @@ void wlr_text_input_v3_send_leave(struct wlr_text_input_v3 *text_input) { } void wlr_text_input_v3_send_preedit_string(struct wlr_text_input_v3 *text_input, - const char *text, uint32_t cursor_begin, uint32_t cursor_end) { + const char *text, int32_t cursor_begin, int32_t cursor_end) { zwp_text_input_v3_send_preedit_string(text_input->resource, text, cursor_begin, cursor_end); }