[gtk+] Don't use GTK_IS_PLUG for non-X11 backends
- From: Kristian Rietveld <kristian src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Don't use GTK_IS_PLUG for non-X11 backends
- Date: Mon, 31 Jan 2011 23:26:37 +0000 (UTC)
commit 9dcdca250106c4b42f3839ad91073b294be5b42c
Author: Kristian Rietveld <kris gtk org>
Date: Tue Feb 1 00:26:04 2011 +0100
Don't use GTK_IS_PLUG for non-X11 backends
gtk/gtkwidget.c | 9 ++++++++-
gtk/gtkwindow.c | 8 +++++++-
2 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a434b42..faa1fc4 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 8e4a7cf..2c4af39 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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]