From d404f13230a1fd59116b51e58806b2eca89baf49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20=22sp1rit=22=E2=80=8B?= Date: Sat, 28 May 2022 17:45:35 +0200 Subject: [PATCH] Gtk.TextView: ensure overlays are rendered above ChildAnchors TextViewChildren are currently rendered before the ChildAnchors get rendered. Since overlay widgets (added with `gtk_text_view_add_overlay`) are using the `center_child` TextViewChild to be rendered, the overlays do not work as one'd imagine an overlay to work, since they appear "behind" any ChildAnchors that might have been added. This commit fixes this by simply moving the snapshot_text_view_child calls behind the loop responsible for rendering the ChildAnchors. --- gtk/gtktextview.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 6df6b6e50f..5f961ac482 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -5878,17 +5878,17 @@ gtk_text_view_snapshot (GtkWidget *widget, draw_text (widget, snapshot); - snapshot_text_view_child (widget, priv->left_child, snapshot); - snapshot_text_view_child (widget, priv->right_child, snapshot); - snapshot_text_view_child (widget, priv->top_child, snapshot); - snapshot_text_view_child (widget, priv->bottom_child, snapshot); - snapshot_text_view_child (widget, priv->center_child, snapshot); - for (iter = priv->anchored_children.head; iter; iter = iter->next) { const AnchoredChild *vc = iter->data; gtk_widget_snapshot_child (widget, vc->widget, snapshot); } + + snapshot_text_view_child (widget, priv->left_child, snapshot); + snapshot_text_view_child (widget, priv->right_child, snapshot); + snapshot_text_view_child (widget, priv->top_child, snapshot); + snapshot_text_view_child (widget, priv->bottom_child, snapshot); + snapshot_text_view_child (widget, priv->center_child, snapshot); } /** -- GitLab