summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorRichard Hult <richard@imendio.com>2007-06-16 21:21:52 +0000
committerRichard Hult <rhult@src.gnome.org>2007-06-16 21:21:52 +0000
commit526fecc2f942a2cbd3fe831f288fad60e26f1f49 (patch)
treecdc5c2aee35da1a204c8138c0ef91deebbf6d586 /gdk
parentd0794b1ce2eaa17dabc14804e1826fd3ae90e842 (diff)
downloadgtk+-526fecc2f942a2cbd3fe831f288fad60e26f1f49.tar.gz
Defer setting the parent until the window is shown, otherwise it gets
2007-06-16 Richard Hult <richard@imendio.com> * gdk/quartz/gdkwindow-quartz.c: (gdk_window_set_transient_for): Defer setting the parent until the window is shown, otherwise it gets unconditionally shown here. svn path=/trunk/; revision=18164
Diffstat (limited to 'gdk')
-rw-r--r--gdk/quartz/gdkwindow-quartz.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 5329ff0cf1..f538e2100f 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -1585,7 +1585,13 @@ gdk_window_set_transient_for (GdkWindow *window,
if (gdk_window_get_type_hint (window) != GDK_WINDOW_TYPE_HINT_TOOLTIP)
{
window_impl->transient_for = g_object_ref (parent);
- [parent_impl->toplevel addChildWindow:window_impl->toplevel ordered:NSWindowAbove];
+
+ /* We only add the window if it is shown, otherwise it will
+ * be shown unconditionally here. If it is not shown, the
+ * window will be added in show() instead.
+ */
+ if (!(GDK_WINDOW_OBJECT (window)->state & GDK_WINDOW_STATE_WITHDRAWN))
+ [parent_impl->toplevel addChildWindow:window_impl->toplevel ordered:NSWindowAbove];
}
}