From: Matthias Clasen Date: Fri, 25 Nov 2022 12:59:35 +0000 (-0500) Subject: text: Prevent unexpected notify::direction emissions X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2^2~15 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9f4baac5a20b16ed12aacf79c2c2eebb5ace45f3;p=gtk4.git text: Prevent unexpected notify::direction emissions Calling gdk_device_get_direction can trigger a notify::direction emissions, since the X11 backend determines the direction on demand. Prevent that by forcing the direction to be determined ahead of time. Fixes: #5311 --- 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);