[goocanvas] Call gtk_widget_get_preferred_size() on child widgets to avoid GTK+ warnings.
- From: Damon Chaplin <damon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goocanvas] Call gtk_widget_get_preferred_size() on child widgets to avoid GTK+ warnings.
- Date: Thu, 15 Dec 2016 10:42:43 +0000 (UTC)
commit 04c874bf46489cf5ab3abe0261a763a0f1974d83
Author: Damon Chaplin <Damon A Chaplin gmail com>
Date: Thu Dec 15 10:41:14 2016 +0000
Call gtk_widget_get_preferred_size() on child widgets to avoid GTK+ warnings.
ChangeLog | 5 +++++
src/goocanvas.c | 4 ++++
2 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 5b50bf6..26fe9f2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-15 Damon Chaplin <damon localhost lan>
+
+ * src/goocanvas.c (goo_canvas_allocate_child_widget): call
+ gtk_widget_get_preferred_size() to stop GTK+ spewing warnings.
+
2016-12-14 Damon Chaplin <damon gnome org>
* src/goocanvas.c: added background_color and background_color_set
diff --git a/src/goocanvas.c b/src/goocanvas.c
index 0bafb56..a7f7463 100644
--- a/src/goocanvas.c
+++ b/src/goocanvas.c
@@ -2011,6 +2011,7 @@ goo_canvas_allocate_child_widget (GooCanvas *canvas,
GooCanvasWidget *witem)
{
GooCanvasBounds bounds;
+ GtkRequisition minimum_size;
GtkAllocation allocation;
goo_canvas_item_get_bounds ((GooCanvasItem*) witem, &bounds);
@@ -2018,6 +2019,9 @@ goo_canvas_allocate_child_widget (GooCanvas *canvas,
goo_canvas_convert_to_pixels (canvas, &bounds.x1, &bounds.y1);
goo_canvas_convert_to_pixels (canvas, &bounds.x2, &bounds.y2);
+ /* Call this to stop GTK+ spewing warnings. */
+ gtk_widget_get_preferred_size (witem->widget, &minimum_size, NULL);
+
/* Note that we only really support integers for the bounds, and we don't
support scaling of a canvas with widget items in it. */
allocation.x = bounds.x1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]