diff options
-rw-r--r-- | gtk/gtktext.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gtk/gtktext.c b/gtk/gtktext.c index 8631dbba71..72daa5d444 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -3234,8 +3234,12 @@ gtk_text_focus_changed (GtkEventControllerFocus *controller, if (gtk_event_controller_focus_is_focus (controller)) { if (keyboard) - g_signal_connect (keyboard, "notify::direction", - G_CALLBACK (direction_changed), self); + { + /* Work around unexpected notify::direction emissions */ + gdk_device_get_direction (keyboard); + g_signal_connect (keyboard, "notify::direction", + G_CALLBACK (direction_changed), self); + } gtk_text_im_set_focus_in (self); gtk_text_reset_blink_time (self); |