mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-07 19:30:12 +00:00
container: Use gtk_container_forall less
Just iterate over the child widgets directly and produce a much nicer stack trace when debugging.
This commit is contained in:
parent
927f2f5c06
commit
0938183ae6
@ -3013,24 +3013,16 @@ gtk_container_draw (GtkWidget *widget,
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
gtk_container_snapshot_forall (GtkWidget *child,
|
|
||||||
gpointer snapshot)
|
|
||||||
{
|
|
||||||
gtk_widget_snapshot_child (_gtk_widget_get_parent (child),
|
|
||||||
child,
|
|
||||||
snapshot);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gtk_container_snapshot (GtkWidget *widget,
|
gtk_container_snapshot (GtkWidget *widget,
|
||||||
GtkSnapshot *snapshot)
|
GtkSnapshot *snapshot)
|
||||||
{
|
{
|
||||||
GtkContainer *container = GTK_CONTAINER (widget);
|
GtkWidget *child;
|
||||||
|
|
||||||
gtk_container_forall (container,
|
for (child = _gtk_widget_get_first_child (widget);
|
||||||
gtk_container_snapshot_forall,
|
child != NULL;
|
||||||
snapshot);
|
child = _gtk_widget_get_next_sibling (child))
|
||||||
|
gtk_widget_snapshot_child (widget, child, snapshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@ -3045,10 +3037,9 @@ gtk_container_should_propagate_draw (GtkContainer *container,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
union_with_clip (GtkWidget *widget,
|
union_with_clip (GtkWidget *widget,
|
||||||
gpointer data)
|
GtkAllocation *clip)
|
||||||
{
|
{
|
||||||
GdkRectangle *clip = data;
|
|
||||||
GtkAllocation widget_clip;
|
GtkAllocation widget_clip;
|
||||||
|
|
||||||
if (!gtk_widget_is_visible (widget) ||
|
if (!gtk_widget_is_visible (widget) ||
|
||||||
@ -3067,9 +3058,14 @@ void
|
|||||||
gtk_container_get_children_clip (GtkContainer *container,
|
gtk_container_get_children_clip (GtkContainer *container,
|
||||||
GtkAllocation *out_clip)
|
GtkAllocation *out_clip)
|
||||||
{
|
{
|
||||||
|
GtkWidget *child;
|
||||||
|
|
||||||
memset (out_clip, 0, sizeof (GtkAllocation));
|
memset (out_clip, 0, sizeof (GtkAllocation));
|
||||||
|
|
||||||
gtk_container_forall (container, union_with_clip, out_clip);
|
for (child = _gtk_widget_get_first_child (GTK_WIDGET (container));
|
||||||
|
child != NULL;
|
||||||
|
child = _gtk_widget_get_next_sibling (child))
|
||||||
|
union_with_clip (child, out_clip);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
Reference in New Issue
Block a user