[gtk/wip/otte/for-master: 1/4] sizerequest: Change critical message
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/for-master: 1/4] sizerequest: Change critical message
- Date: Sun, 21 Nov 2021 00:52:53 +0000 (UTC)
commit eefb6a0dd4d57a58420d7a6eb76dd95dff1d5bb3
Author: Benjamin Otte <otte redhat com>
Date: Sat Nov 20 16:59:50 2021 +0100
sizerequest: Change critical message
Printing the affected widget leads people to assume that it is to blame
for the error. However, the widget is the object the function is being
called on, not the caller. And the caller is doing it wrong.
Usually the caller is the parent widget, so we could print that one, but
it's only usually, it can be an issue propagating from a grandparent and
it doesn't tell you from where the function is called (allocation or
measuring), so you need a debugger anyway.
So don't put anything there instead.
gtk/gtksizerequest.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index a2a8af3f84..21ee564182 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -494,8 +494,8 @@ gtk_widget_measure (GtkWidget *widget,
gtk_widget_measure (widget, OPPOSITE_ORIENTATION (orientation), -1, &min_opposite_size, NULL, NULL,
NULL);
if (for_size < min_opposite_size)
{
- g_critical ("gtk_widget_measure: assertion 'for_size >= minimum opposite size' failed for %s %p:
%u >= %u",
- G_OBJECT_TYPE_NAME (widget), widget, for_size, min_opposite_size);
+ g_critical ("gtk_widget_measure: assertion 'for_size >= minimum opposite size' failed: %u >= %u",
+ for_size, min_opposite_size);
for_size = min_opposite_size;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]