summaryrefslogtreecommitdiff
path: root/gtk/gtksizerequest.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-05-07 17:37:36 +0200
committerBenjamin Otte <otte@redhat.com>2012-05-07 17:37:36 +0200
commit5722f9ab0f0deef12513a99e908637500e38050b (patch)
tree5231bf95111d3ca2cfbe3a26e95c838f1b4d92d0 /gtk/gtksizerequest.c
parent86cebc9b43cfad08f6d4ad5a268d26b2285394c8 (diff)
downloadgtk+-5722f9ab0f0deef12513a99e908637500e38050b.tar.gz
sizerequest: Improve warning message
Actually print out the function we're warning about
Diffstat (limited to 'gtk/gtksizerequest.c')
-rw-r--r--gtk/gtksizerequest.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index f7d869ef57..0a9b1bacc2 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -316,6 +316,16 @@ commit_cached_size (GtkWidget *widget,
}
}
+static const char *
+get_vfunc_name (GtkSizeGroupMode orientation,
+ gint for_size)
+{
+ if (orientation == GTK_SIZE_GROUP_HORIZONTAL)
+ return for_size < 0 ? "get_preferred_width" : "get_preferred_width_for_height";
+ else
+ return for_size < 0 ? "get_preferred_height" : "get_preferred_height_for_width";
+}
+
/* This is the main function that checks for a cached size and
* possibly queries the widget class to compute the size if it's
* not cached. If the for_size here is -1, then get_preferred_width()
@@ -410,8 +420,8 @@ compute_size_for_orientation (GtkWidget *widget,
if (min_size > nat_size)
{
- g_warning ("%s %p reported min size %d and natural size %d; natural size must be >= min size",
- G_OBJECT_TYPE_NAME (widget), widget, min_size, nat_size);
+ g_warning ("%s %p reported min size %d and natural size %d in %s(); natural size must be >= min size",
+ G_OBJECT_TYPE_NAME (widget), widget, min_size, nat_size, get_vfunc_name (orientation, for_size));
}
if (orientation == GTK_SIZE_GROUP_HORIZONTAL)