sizerequest: Change critical message
authorBenjamin Otte <otte@redhat.com>
Sat, 20 Nov 2021 15:59:50 +0000 (16:59 +0100)
committerBenjamin Otte <otte@redhat.com>
Sat, 20 Nov 2021 16:05:36 +0000 (17:05 +0100)
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

index a2a8af3f847bf6c119d55708b8ba9f058d1dfbc8..21ee564182e416ab6d1ba8358d76c007db0e3d20 100644 (file)
@@ -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;
         }
     }