Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 1325db1

Browse files
committed
Don't process key events when the text input is not requested
1 parent 1ddc6e1 commit 1325db1

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

shell/platform/linux/fl_text_input_plugin.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ FlTextInputPlugin* fl_text_input_plugin_new(FlBinaryMessenger* messenger) {
288288
gboolean fl_text_input_plugin_filter_keypress(FlTextInputPlugin* self,
289289
GdkEventKey* event) {
290290
g_return_val_if_fail(FL_IS_TEXT_INPUT_PLUGIN(self), FALSE);
291+
292+
if (self->client_id == kClientIdUnset)
293+
return FALSE;
294+
291295
if (gtk_im_context_filter_keypress(self->im_context, event))
292296
return TRUE;
293297

shell/platform/linux/fl_view.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,11 +330,11 @@ static gboolean fl_view_motion_notify_event(GtkWidget* widget,
330330
static gboolean fl_view_key_press_event(GtkWidget* widget, GdkEventKey* event) {
331331
FlView* self = FL_VIEW(widget);
332332

333+
fl_key_event_plugin_send_key_event(self->key_event_plugin, event);
334+
333335
if (fl_text_input_plugin_filter_keypress(self->text_input_plugin, event))
334336
return TRUE;
335337

336-
fl_key_event_plugin_send_key_event(self->key_event_plugin, event);
337-
338338
return TRUE;
339339
}
340340

@@ -343,11 +343,11 @@ static gboolean fl_view_key_release_event(GtkWidget* widget,
343343
GdkEventKey* event) {
344344
FlView* self = FL_VIEW(widget);
345345

346+
fl_key_event_plugin_send_key_event(self->key_event_plugin, event);
347+
346348
if (fl_text_input_plugin_filter_keypress(self->text_input_plugin, event))
347349
return TRUE;
348350

349-
fl_key_event_plugin_send_key_event(self->key_event_plugin, event);
350-
351351
return TRUE;
352352
}
353353

0 commit comments

Comments
 (0)