From 02187371a2e45bbd20d48dc474b72cfd6dbd0cbe Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sat, 6 Aug 2016 10:23:20 -0400 Subject: [PATCH] Add details to css render nodes Give all nodes the same detail about the owner widget. This reveals that every GtkCssCustomGadget gets a DrawGadgetContents node, even if their draw_func is NULL. We may want to come up with a better solution for that. --- gtk/gtkcssgadget.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gtk/gtkcssgadget.c b/gtk/gtkcssgadget.c index 604c62e727..1074d1a7ec 100644 --- a/gtk/gtkcssgadget.c +++ b/gtk/gtkcssgadget.c @@ -908,7 +908,8 @@ gtk_css_gadget_get_render_node (GtkCssGadget *gadget, { content_node = gsk_renderer_create_render_node (renderer); - gsk_render_node_set_name (content_node, "DrawGadgetContent"); + str = g_strconcat ("DrawGadgetContent<", G_OBJECT_TYPE_NAME (gtk_css_gadget_get_owner (gadget)), ">", NULL); + gsk_render_node_set_name (content_node, str); gsk_render_node_set_bounds (content_node, &content_bounds); gsk_render_node_set_transform (content_node, &content_transform); @@ -919,6 +920,7 @@ gtk_css_gadget_get_render_node (GtkCssGadget *gadget, contents_x, contents_y, contents_width, contents_height); + g_free (str); cairo_destroy (cr); gsk_render_node_append_child (bg_node, content_node); @@ -930,7 +932,8 @@ gtk_css_gadget_get_render_node (GtkCssGadget *gadget, { GskRenderNode *focus_node = gsk_renderer_create_render_node (renderer); - gsk_render_node_set_name (focus_node, "Focus"); + str = g_strconcat ("Focus<", G_OBJECT_TYPE_NAME (gtk_css_gadget_get_owner (gadget)), ">", NULL); + gsk_render_node_set_name (focus_node, str); gsk_render_node_set_bounds (focus_node, &bounds); cr = gsk_render_node_get_draw_context (focus_node); @@ -940,6 +943,7 @@ gtk_css_gadget_get_render_node (GtkCssGadget *gadget, margin.top, width - margin.left - margin.right, height - margin.top - margin.bottom); + g_free (str); cairo_destroy (cr); gsk_render_node_append_child (bg_node, focus_node);