From 5e91989846adf6e2474815836ec2198f29db3030 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 9 Jul 2025 12:21:46 +0800 Subject: [PATCH] opt: optimzie text-input --- src/ext-protocol/text-input.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ext-protocol/text-input.h b/src/ext-protocol/text-input.h index f522440..89444f3 100644 --- a/src/ext-protocol/text-input.h +++ b/src/ext-protocol/text-input.h @@ -301,9 +301,8 @@ static void handle_input_method_commit(struct wl_listener *listener, void *data) { struct dwl_input_method_relay *relay = wl_container_of(listener, relay, input_method_commit); - struct wlr_input_method_v2 *input_method = data; struct text_input *text_input; - assert(relay->input_method == input_method); + struct wlr_input_method_v2 *input_method = relay->input_method; text_input = relay->active_text_input; if (!text_input) { @@ -333,7 +332,8 @@ static void handle_keyboard_grab_destroy(struct wl_listener *listener, void *data) { struct dwl_input_method_relay *relay = wl_container_of(listener, relay, keyboard_grab_destroy); - struct wlr_input_method_keyboard_grab_v2 *keyboard_grab = data; + struct wlr_input_method_keyboard_grab_v2 *keyboard_grab = + relay->input_method->keyboard_grab; wl_list_remove(&relay->keyboard_grab_destroy.link); if (keyboard_grab->keyboard) { @@ -365,7 +365,6 @@ static void handle_input_method_destroy(struct wl_listener *listener, void *data) { struct dwl_input_method_relay *relay = wl_container_of(listener, relay, input_method_destroy); - assert(relay->input_method == data); wl_list_remove(&relay->input_method_commit.link); wl_list_remove(&relay->input_method_grab_keyboard.link); wl_list_remove(&relay->input_method_new_popup_surface.link);