diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index a434b429e7..faa1fc4359 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -9249,6 +9249,8 @@ gtk_widget_set_parent_window (GtkWidget *widget, if (parent_window != old_parent_window) { + gboolean is_plug; + g_object_set_qdata (G_OBJECT (widget), quark_parent_window, parent_window); if (old_parent_window) @@ -9260,7 +9262,12 @@ gtk_widget_set_parent_window (GtkWidget *widget, * this is the primary entry point to allow toplevels to be * embeddable. */ - if (GTK_IS_WINDOW (widget) && !GTK_IS_PLUG (widget)) +#ifdef GDK_WINDOWING_X11 + is_plug = GTK_IS_PLUG (widget); +#else + is_plug = FALSE; +#endif + if (GTK_IS_WINDOW (widget) && !is_plug) _gtk_window_set_is_toplevel (GTK_WINDOW (widget), parent_window == NULL); } } diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 8e4a7cfb84..2c4af396ef 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -4587,6 +4587,7 @@ gtk_window_show (GtkWidget *widget) GtkWindowPrivate *priv = window->priv; GtkContainer *container = GTK_CONTAINER (window); gboolean need_resize; + gboolean is_plug; if (!gtk_widget_is_toplevel (GTK_WIDGET (widget))) { @@ -4658,7 +4659,12 @@ gtk_window_show (GtkWidget *widget) /* Try to make sure that we have some focused widget */ - if (!priv->focus_widget && !GTK_IS_PLUG (window)) +#ifdef GDK_WINDOWING_X11 + is_plug = GTK_IS_PLUG (window); +#else + is_plug = FALSE; +#endif + if (!priv->focus_widget && !is_plug) gtk_window_move_focus (widget, GTK_DIR_TAB_FORWARD); if (priv->modal)