From 01ed444267dd52e94c7f74f6bdbb757b1b61421d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 Feb 2016 02:34:41 +0100 Subject: [PATCH] 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. --- src/gtk/win_gtk.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gtk/win_gtk.cpp b/src/gtk/win_gtk.cpp index b0f7721f36..ab6ddd363f 100644 --- a/src/gtk/win_gtk.cpp +++ b/src/gtk/win_gtk.cpp @@ -115,7 +115,14 @@ static void pizza_size_allocate(GtkWidget* widget, GtkAllocation* alloc) child_alloc.height = child->height; if (gtk_widget_get_direction(widget) == GTK_TEXT_DIR_RTL) child_alloc.x = w - child_alloc.x - child_alloc.width; - gtk_widget_size_allocate(child->widget, &child_alloc); + + // 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); + } } } }