mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 19:00:08 +00:00
container: ensure we only append a single node
The snapshot vfuncs must only append at most a single node, otherwise things are going to break if the widget is the root node. Unfortunately there is no code that can check this in a generic fashion, so we'll have to debug this on a case-by-case basis.
This commit is contained in:
parent
2e9ff11c85
commit
f728f33382
@ -3095,10 +3095,21 @@ gtk_container_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
GtkContainer *container = GTK_CONTAINER (widget);
|
||||
|
||||
GtkAllocation allocation, clip;
|
||||
graphene_rect_t bounds;
|
||||
|
||||
gtk_widget_get_clip (widget, &clip);
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
graphene_rect_init (&bounds,
|
||||
clip.x - allocation.x, clip.y - allocation.y,
|
||||
clip.width, clip.height);
|
||||
gtk_snapshot_push (snapshot, &bounds, "Children<%s>", G_OBJECT_TYPE_NAME (container));
|
||||
|
||||
gtk_container_forall (container,
|
||||
gtk_container_snapshot_forall,
|
||||
snapshot);
|
||||
|
||||
gtk_snapshot_pop (snapshot);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user