diff --git a/search.c b/search.c index 83f86390..a7b6f112 100644 --- a/search.c +++ b/search.c @@ -99,6 +99,12 @@ search_cancel_keep_selection(struct terminal *term) term->is_searching = false; term->render.search_glyph_offset = 0; + /* Reset IME state */ + if (term_ime_is_enabled(term)) { + term_ime_disable(term); + term_ime_enable(term); + } + term_xcursor_update(term); render_refresh(term); } @@ -111,6 +117,12 @@ search_begin(struct terminal *term) search_cancel_keep_selection(term); selection_cancel(term); + /* Reset IME state */ + if (term_ime_is_enabled(term)) { + term_ime_disable(term); + term_ime_enable(term); + } + /* On-demand instantiate wayland surface */ struct wl_window *win = term->window; struct wayland *wayl = term->wl;