From: Vadim Zeitlin Date: Mon, 10 Jun 2013 15:53:04 +0000 (+0000) Subject: Avoid problems when reparenting a TLW under a child in wxGTK. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/4775836d3736c6a4ac84d6427c4c619134816530 Avoid problems when reparenting a TLW under a child in wxGTK. Don't use a TLW with gtk_fixed_put(). Closes #15237. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74155 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/gtk/win_gtk.cpp b/src/gtk/win_gtk.cpp index 91f6cf031c..9d05f09a5d 100644 --- a/src/gtk/win_gtk.cpp +++ b/src/gtk/win_gtk.cpp @@ -379,7 +379,10 @@ void wxPizza::move(GtkWidget* widget, int x, int y, int width, int height) void wxPizza::put(GtkWidget* widget, int x, int y, int width, int height) { - gtk_fixed_put(GTK_FIXED(this), widget, 0, 0); + // Re-parenting a TLW under a child window is possible at wx level but + // using a TLW as child at GTK+ level results in problems, so don't do it. + if (!gtk_widget_is_toplevel(GTK_WIDGET(widget))) + gtk_fixed_put(GTK_FIXED(this), widget, 0, 0); wxPizzaChild* child = new wxPizzaChild; child->widget = widget;