Skip to content

Commit e4d542f

Browse files
author
徐扬斌
committed
GTK: Fix potential IME input focus bug.
Do not wait idle to set the IME context focus, just set it right after the focus event process finished to fix potential IME input focus miss.
1 parent c46f13c commit e4d542f

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/gtk/window.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4755,13 +4755,7 @@ bool wxWindowGTK::GTKHandleFocusIn()
47554755
if (m_imContext)
47564756
{
47574757
// delay gtk_im_context_focus_in to avoid timing conflict with IME framework(fcitx)
4758-
g_idle_add([](gpointer data) -> gboolean {
4759-
GtkIMContext* context = static_cast<GtkIMContext*>(data);
4760-
if (context) {
4761-
gtk_im_context_focus_in(context);
4762-
}
4763-
return G_SOURCE_REMOVE; // only run once
4764-
}, m_imContext);
4758+
gtk_im_context_focus_in(m_imContext);
47654759
}
47664760

47674761
return retval;

0 commit comments

Comments
 (0)