From be9a30d55513dd12d32098de00d4579ee4cc0da7 Mon Sep 17 00:00:00 2001 From: ShootingStarDragons Date: Sun, 21 Jan 2024 21:25:36 +0800 Subject: [PATCH] Revert "fix: coredump when popup exist and close window" since the popup is under root top, so the node will always exist, so refresh is safe This reverts commit d3bedbd63704c8a4f695a6a650e8440ae5c9593b. --- sway/input/text_input.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sway/input/text_input.c b/sway/input/text_input.c index 80b334e6d..901d85fec 100644 --- a/sway/input/text_input.c +++ b/sway/input/text_input.c @@ -118,7 +118,7 @@ static void handle_im_destroy(struct wl_listener *listener, void *data) { } static void relay_send_im_state(struct sway_input_method_relay *relay, - struct wlr_text_input_v3 *input, bool need_refresh) { + struct wlr_text_input_v3 *input) { struct wlr_input_method_v2 *input_method = relay->input_method; if (!input_method) { sway_log(SWAY_INFO, "Sending IM_DONE but im is gone"); @@ -139,9 +139,6 @@ static void relay_send_im_state(struct sway_input_method_relay *relay, } struct sway_input_popup *popup; wl_list_for_each(popup, &relay->input_popups, link) { - if (!need_refresh) { - popup->scene_tree = NULL; - } // send_text_input_rectangle is called in this function input_popup_update(popup); } @@ -157,7 +154,7 @@ static void handle_text_input_enable(struct wl_listener *listener, void *data) { return; } wlr_input_method_v2_send_activate(text_input->relay->input_method); - relay_send_im_state(text_input->relay, text_input->input, false); + relay_send_im_state(text_input->relay, text_input->input); } static void handle_text_input_commit(struct wl_listener *listener, @@ -173,7 +170,7 @@ static void handle_text_input_commit(struct wl_listener *listener, sway_log(SWAY_INFO, "Text input committed, but input method is gone"); return; } - relay_send_im_state(text_input->relay, text_input->input, true); + relay_send_im_state(text_input->relay, text_input->input); } static void relay_disable_text_input(struct sway_input_method_relay *relay, @@ -183,7 +180,7 @@ static void relay_disable_text_input(struct sway_input_method_relay *relay, return; } wlr_input_method_v2_send_deactivate(relay->input_method); - relay_send_im_state(relay, text_input->input, false); + relay_send_im_state(relay, text_input->input); } static void handle_text_input_disable(struct wl_listener *listener, @@ -425,7 +422,6 @@ static void handle_im_focused_surface_unmap( struct sway_input_popup *popup = wl_container_of(listener, popup, focused_surface_unmap); //input_popup_send_outputs(popup, surface_send_leave_iterator); - popup->scene_tree = NULL; input_popup_update(popup); }