summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2021-03-12 19:44:31 -0500
committerMatthias Clasen <mclasen@redhat.com>2021-03-12 19:44:31 -0500
commite345f9a4db48a1d06cd941e49b7d7d922ff19607 (patch)
tree2f52303008bfeb31bb12515c4dbc9e564148d9c3
parentdaed57c30ee7e6e152578902090352028cf776e9 (diff)
downloadgtk+-e345f9a4db48a1d06cd941e49b7d7d922ff19607.tar.gz
textview: Fix blinking block cursors
When we have a block cursor, we need to discard the cached node of the line containing the cursor, in order to get a blinking cursor.
-rw-r--r--gtk/gtktextlayout.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index 9c994137ae..027ae9ca74 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -4232,6 +4232,13 @@ gtk_text_layout_snapshot (GtkTextLayout *layout,
selection_end_index = -1;
}
+ if (line_display->node != NULL)
+ {
+ if (line_display->has_block_cursor &&
+ gtk_widget_has_focus (widget))
+ g_clear_pointer (&line_display->node, gsk_render_node_unref);
+ }
+
if (line_display->node == NULL)
{
gtk_snapshot_push_collect (snapshot);