Don't use GTK_IS_PLUG for non-X11 backends

This commit is contained in:
Kristian Rietveld 2011-02-01 00:26:04 +01:00
parent 73afbc954a
commit 9dcdca2501
2 changed files with 15 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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)