flowbox: Stop using gtk_render_background
authorMatthias Clasen <mclasen@redhat.com>
Sat, 8 Oct 2022 12:28:46 +0000 (08:28 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 11 Oct 2022 21:18:21 +0000 (17:18 -0400)
The gtk_render_ apis are getting deprecated.

gtk/gtkflowbox.c

index 16ae39cfb50d3a8e0f9170cc847325386f6f2769..38eeeaff64bf1d735bb40cce89c43584c130140a 100644 (file)
@@ -2570,6 +2570,8 @@ gtk_flow_box_snapshot (GtkWidget   *widget,
           cairo_path_t *path;
           GtkBorder border;
           const GdkRGBA *border_color;
+          GtkSnapshot *bg_snapshot;
+          GskRenderNode *node;
 
           if (vertical)
             path_from_vertical_line_rects (cr, (GdkRectangle *)lines->data, lines->len);
@@ -2583,7 +2585,16 @@ gtk_flow_box_snapshot (GtkWidget   *widget,
 
           cairo_save (cr);
           cairo_clip (cr);
-          gtk_render_background (context, cr, x, y, width, height);
+
+          bg_snapshot = gtk_snapshot_new ();
+          gtk_snapshot_render_background (bg_snapshot, context, x, y, width, height);
+          node = gtk_snapshot_free_to_node (bg_snapshot);
+          if (node)
+            {
+              gsk_render_node_draw (node, cr);
+              gsk_render_node_unref (node);
+            }
+
           cairo_restore (cr);
 
           cairo_append_path (cr, path);