You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.4 KiB
37 lines
1.4 KiB
diff -up wxWidgets-3.0.2/src/gtk/win_gtk.cpp.size-alloc-fix wxWidgets-3.0.2/src/gtk/win_gtk.cpp
|
|
--- wxWidgets-3.0.2/src/gtk/win_gtk.cpp.size-alloc-fix 2016-04-04 14:55:37.647728846 -0400
|
|
+++ wxWidgets-3.0.2/src/gtk/win_gtk.cpp 2016-04-04 14:56:36.199637226 -0400
|
|
@@ -192,8 +192,24 @@ static void pizza_remove(GtkContainer* c
|
|
}
|
|
|
|
#ifdef __WXGTK3__
|
|
+// Get preferred size of children, to avoid GTK+ warnings complaining
|
|
+// that they were size-allocated without asking their preferred size
|
|
+static void children_get_preferred_size(const GList* p)
|
|
+{
|
|
+ for (; p; p = p->next)
|
|
+ {
|
|
+ const wxPizzaChild* child = static_cast<wxPizzaChild*>(p->data);
|
|
+ if (gtk_widget_get_visible(child->widget))
|
|
+ {
|
|
+ GtkRequisition req;
|
|
+ gtk_widget_get_preferred_size(child->widget, &req, NULL);
|
|
+ }
|
|
+ }
|
|
+}
|
|
+
|
|
static void pizza_get_preferred_width(GtkWidget* widget, int* minimum, int* natural)
|
|
{
|
|
+ children_get_preferred_size(WX_PIZZA(widget)->m_children);
|
|
*minimum = 0;
|
|
gtk_widget_get_size_request(widget, natural, NULL);
|
|
if (*natural < 0)
|
|
@@ -202,6 +218,7 @@ static void pizza_get_preferred_width(Gt
|
|
|
|
static void pizza_get_preferred_height(GtkWidget* widget, int* minimum, int* natural)
|
|
{
|
|
+ children_get_preferred_size(WX_PIZZA(widget)->m_children);
|
|
*minimum = 0;
|
|
gtk_widget_get_size_request(widget, NULL, natural);
|
|
if (*natural < 0)
|