(e_dialog_set_transient_for_xid): #ifdef out gtk 2.2 api usage

svn path=/trunk/; revision=20505
This commit is contained in:
Dan Winship
2003-03-25 16:28:33 +00:00
parent 4670b852ed
commit 264ed440fd
2 changed files with 11 additions and 3 deletions

View File

@ -8,6 +8,7 @@
deprecated and only used in one place.
(e_file_dialog_save): Make this use GtkMessageDialog instead of
GnomeDialog
(e_dialog_set_transient_for_xid): #ifdef out gtk 2.2 api usage
2003-03-25 Not Zed <NotZed@Ximian.com>

View File

@ -196,7 +196,9 @@ void
e_dialog_set_transient_for_xid (GtkWindow *dialog,
GdkNativeWindow xid)
{
#ifdef GDK_MULTIHEAD_SAFE
GdkDisplay *display;
#endif
GdkWindow *parent;
g_return_if_fail (GTK_IS_WINDOW (dialog));
@ -208,12 +210,17 @@ e_dialog_set_transient_for_xid (GtkWindow *dialog,
return;
}
#ifdef GDK_MULTIHEAD_SAFE
display = gdk_drawable_get_display (GDK_DRAWABLE (GTK_WIDGET (dialog)->window));
parent = gdk_window_lookup_for_display (display, xid);
if (!parent) {
if (!parent)
parent = gdk_window_foreign_new_for_display (display, xid);
g_return_if_fail (parent != NULL);
}
#else
parent = gdk_window_lookup (xid);
if (!parent)
parent = gdk_window_foreign_new (xid);
#endif
g_return_if_fail (parent != NULL);
gdk_window_set_transient_for (GTK_WIDGET (dialog)->window, parent);
}