From 3fe0d1f1d078dd0af029c329eb90f9828a3c39da Mon Sep 17 00:00:00 2001 From: William Wold Date: Thu, 5 Nov 2020 15:22:17 -0500 Subject: [PATCH] Set the IM context when showing the input method (flutter/engine#21896) --- .../src/flutter/shell/platform/linux/fl_text_input_plugin.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/engine/src/flutter/shell/platform/linux/fl_text_input_plugin.cc b/engine/src/flutter/shell/platform/linux/fl_text_input_plugin.cc index 492f0ae681..2841db1e79 100644 --- a/engine/src/flutter/shell/platform/linux/fl_text_input_plugin.cc +++ b/engine/src/flutter/shell/platform/linux/fl_text_input_plugin.cc @@ -258,6 +258,11 @@ static FlMethodResponse* set_client(FlTextInputPlugin* self, FlValue* args) { // Shows the input method. static FlMethodResponse* show(FlTextInputPlugin* self) { + // Set the top-level window used for system input method windows. + GdkWindow* window = + gtk_widget_get_window(gtk_widget_get_toplevel(GTK_WIDGET(self->view))); + gtk_im_context_set_client_window(self->im_context, window); + gtk_im_context_focus_in(self->im_context); return FL_METHOD_RESPONSE(fl_method_success_response_new(nullptr));