diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 35a695e080..60bcb9d533 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -11462,6 +11462,7 @@ gtk_widget_render (GtkWidget *widget, GdkSurface *surface, const cairo_region_t *region) { + GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget); GtkSnapshot *snapshot; GskRenderer *renderer; GskRenderNode *root; @@ -11497,7 +11498,8 @@ gtk_widget_render (GtkWidget *widget, renderer, surface, region, - root); + root, + priv->render_node); gsk_renderer_render (renderer, root, region); diff --git a/gtk/inspector/updatesoverlay.c b/gtk/inspector/updatesoverlay.c index cac2a1c4f3..828f7c662c 100644 --- a/gtk/inspector/updatesoverlay.c +++ b/gtk/inspector/updatesoverlay.c @@ -172,15 +172,10 @@ gtk_updates_overlay_snapshot (GtkInspectorOverlay *overlay, GtkUpdate *draw; gint64 now; GList *l; - double native_x, native_y; if (!GTK_IS_NATIVE (widget)) return; - /* The coordinates we're getting from GdkSurface API are in GdkSurface coordinate spaces, - * but we're snapshotting in widget space, so we need to transform */ - gtk_native_get_surface_transform (GTK_NATIVE (widget), &native_x, &native_y); - updates = gtk_update_overlay_lookup_for_widget (self, widget, TRUE); now = gdk_frame_clock_get_frame_time (gtk_widget_get_frame_clock (widget)); @@ -234,7 +229,7 @@ gtk_updates_overlay_snapshot (GtkInspectorOverlay *overlay, cairo_region_get_rectangle (draw->region, i, &rect); gtk_snapshot_append_color (snapshot, &(GdkRGBA) { 1, 0, 0, 0.4 * (1 - progress) }, - &GRAPHENE_RECT_INIT(rect.x - native_x, rect.y - native_y, + &GRAPHENE_RECT_INIT(rect.x, rect.y, rect.width, rect.height)); } } diff --git a/gtk/inspector/window.c b/gtk/inspector/window.c index 61b3a9aed9..3f0d8c031d 100644 --- a/gtk/inspector/window.c +++ b/gtk/inspector/window.c @@ -780,24 +780,25 @@ gtk_inspector_prepare_render (GtkWidget *widget, GskRenderer *renderer, GdkSurface *surface, const cairo_region_t *region, - GskRenderNode *node) + GskRenderNode *root, + GskRenderNode *widget_node) { GtkInspectorWindow *iw; iw = gtk_inspector_window_get_for_display (gtk_widget_get_display (widget)); if (iw == NULL) - return node; + return root; /* sanity check for single-display GDK backends */ if (GTK_WIDGET (iw) == widget) - return node; + return root; gtk_inspector_recorder_record_render (GTK_INSPECTOR_RECORDER (iw->widget_recorder), widget, renderer, surface, region, - node); + root); if (iw->overlays) { @@ -806,7 +807,7 @@ gtk_inspector_prepare_render (GtkWidget *widget, double native_x, native_y; snapshot = gtk_snapshot_new (); - gtk_snapshot_append_node (snapshot, node); + gtk_snapshot_append_node (snapshot, root); gtk_native_get_surface_transform (GTK_NATIVE (widget), &native_x, &native_y); @@ -815,16 +816,16 @@ gtk_inspector_prepare_render (GtkWidget *widget, for (l = iw->overlays; l; l = l->next) { - gtk_inspector_overlay_snapshot (l->data, snapshot, node, widget); + gtk_inspector_overlay_snapshot (l->data, snapshot, widget_node, widget); } gtk_snapshot_restore (snapshot); - gsk_render_node_unref (node); - node = gtk_snapshot_free_to_node (snapshot); + gsk_render_node_unref (root); + root = gtk_snapshot_free_to_node (snapshot); } - return node; + return root; } gboolean diff --git a/gtk/inspector/window.h b/gtk/inspector/window.h index 5d860b2f76..90841a8ae4 100644 --- a/gtk/inspector/window.h +++ b/gtk/inspector/window.h @@ -154,7 +154,8 @@ GskRenderNode * gtk_inspector_prepare_render GskRenderer *renderer, GdkSurface *surface, const cairo_region_t *region, - GskRenderNode *node); + GskRenderNode *root, + GskRenderNode *widget_node); gboolean gtk_inspector_handle_event (GdkEvent *event); G_END_DECLS