Avoid allocating empty size for wxGTK widgets
This suppresses warning messages from GTK+ (pixman to be more precise) if there is really no space left for a widget and doesn't seem to have any ill effects. Closes #16996.
This commit is contained in:
@@ -115,10 +115,17 @@ static void pizza_size_allocate(GtkWidget* widget, GtkAllocation* alloc)
|
|||||||
child_alloc.height = child->height;
|
child_alloc.height = child->height;
|
||||||
if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL)
|
if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL)
|
||||||
child_alloc.x = w - child_alloc.x - child_alloc.width;
|
child_alloc.x = w - child_alloc.x - child_alloc.width;
|
||||||
|
|
||||||
|
// GTK+3 doesn't like allocating 0 size, so don't do it.
|
||||||
|
#ifdef __WXGTK3__
|
||||||
|
if (child_alloc.width && child_alloc.height)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
gtk_widget_size_allocate(child->widget, &child_alloc);
|
gtk_widget_size_allocate(child->widget, &child_alloc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void pizza_realize(GtkWidget* widget)
|
static void pizza_realize(GtkWidget* widget)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user