gtktextview: Fixed arrow key crash.
authorJordan Yelloz <jordan@yelloz.me>
Tue, 21 Sep 2021 15:47:32 +0000 (08:47 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 31 Oct 2021 21:52:04 +0000 (17:52 -0400)
When pressing the keyboard arrows to move around when the insertion point is
hidden, it causes an assertion error in blink_cb.

Insertion point blinks should only be scheduled when blinking is enabled and the
insertion point is visible.

Closes #4275

gtk/gtktextview.c

index 4bd918fbcf2b15214e7b4bf2a2f8cdb56d6053ec..e58e3c5c02b60ed174d08b84600796425f002ab4 100644 (file)
@@ -6200,7 +6200,7 @@ gtk_text_view_check_cursor_blink (GtkTextView *text_view)
 static void
 gtk_text_view_pend_cursor_blink (GtkTextView *text_view)
 {
-  if (cursor_blinks (text_view))
+  if (cursor_blinks (text_view) && cursor_visible (text_view))
     {
       remove_blink_timeout (text_view);
       add_blink_timeout (text_view, TRUE);