From e3f31cc17f1bfb39c431741bfa99086822c62e90 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Tue, 14 Jan 2020 18:16:26 +0000 Subject: [PATCH] imservice: Rename commit_state to done to match protocol --- src/imservice.c | 4 ++-- src/imservice.rs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/imservice.c b/src/imservice.c index 1c98aa15..2a6184c8 100644 --- a/src/imservice.c +++ b/src/imservice.c @@ -8,7 +8,7 @@ void imservice_handle_input_method_activate(void *data, struct zwp_input_method_ void imservice_handle_input_method_deactivate(void *data, struct zwp_input_method_v2 *input_method); void imservice_handle_surrounding_text(void *data, struct zwp_input_method_v2 *input_method, const char *text, uint32_t cursor, uint32_t anchor); -void imservice_handle_commit_state(void *data, struct zwp_input_method_v2 *input_method); +void imservice_handle_done(void *data, struct zwp_input_method_v2 *input_method); void imservice_handle_content_type(void *data, struct zwp_input_method_v2 *input_method, uint32_t hint, uint32_t purpose); void imservice_handle_text_change_cause(void *data, struct zwp_input_method_v2 *input_method, uint32_t cause); void imservice_handle_unavailable(void *data, struct zwp_input_method_v2 *input_method); @@ -19,7 +19,7 @@ static const struct zwp_input_method_v2_listener input_method_listener = { .surrounding_text = imservice_handle_surrounding_text, .text_change_cause = imservice_handle_text_change_cause, .content_type = imservice_handle_content_type, - .done = imservice_handle_commit_state, + .done = imservice_handle_done, .unavailable = imservice_handle_unavailable, }; diff --git a/src/imservice.rs b/src/imservice.rs index 5da9ee0b..f5989a11 100644 --- a/src/imservice.rs +++ b/src/imservice.rs @@ -122,13 +122,12 @@ pub mod c { #[no_mangle] pub extern "C" - fn imservice_handle_commit_state(imservice: *mut IMService, + fn imservice_handle_done(imservice: *mut IMService, im: *const InputMethod) { let imservice = check_imservice(imservice, im).unwrap(); let active_changed = imservice.current.active ^ imservice.pending.active; - - imservice.serial += Wrapping(1u32); + imservice.current = imservice.pending.clone(); imservice.pending = IMProtocolState { active: imservice.current.active,