diff --git a/include/wx/gtk/private/gtk2-compat.h b/include/wx/gtk/private/gtk2-compat.h index 20e9358d90..76a6075857 100644 --- a/include/wx/gtk/private/gtk2-compat.h +++ b/include/wx/gtk/private/gtk2-compat.h @@ -298,6 +298,12 @@ static inline void wx_gtk_widget_set_allocation(GtkWidget* widget, const GtkAllo } #define gtk_widget_set_allocation wx_gtk_widget_set_allocation +static inline gboolean wx_gtk_widget_is_toplevel(GtkWidget* widget) +{ + return GTK_WIDGET_TOPLEVEL(widget); +} +#define gtk_widget_is_toplevel wx_gtk_widget_is_toplevel + // ---------------------------------------------------------------------------- // the following were introduced in GTK+ 2.20 diff --git a/src/gtk/win_gtk.cpp b/src/gtk/win_gtk.cpp index 538305505d..b65a38e3d0 100644 --- a/src/gtk/win_gtk.cpp +++ b/src/gtk/win_gtk.cpp @@ -380,11 +380,7 @@ void wxPizza::put(GtkWidget* widget, int x, int y, int width, int height) { // 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_CHECK_VERSION(2,19,3) if (!gtk_widget_is_toplevel(GTK_WIDGET(widget))) -#else - if (!GTK_WIDGET_TOPLEVEL(GTK_WIDGET(widget))) -#endif gtk_fixed_put(GTK_FIXED(this), widget, 0, 0); wxPizzaChild* child = new wxPizzaChild;