libgimpwidgets: use new GdkWindow API only when available

This commit is contained in:
Michael Natterer 2011-01-23 00:30:58 +01:00
parent 33479c1086
commit 3ef31e4cc8

View file

@ -404,6 +404,7 @@ gtk_widget_get_translation_to_window (GtkWidget *widget,
widget_window = gtk_widget_get_window (widget);
#if GTK_CHECK_VERSION (2, 22, 0)
for (w = window;
w && w != widget_window;
w = gdk_window_get_effective_parent (w))
@ -415,6 +416,15 @@ gtk_widget_get_translation_to_window (GtkWidget *widget,
*x += px;
*y += py;
}
#else
for (w = window; w && w != widget_window; w = gdk_window_get_parent (w))
{
int wx, wy;
gdk_window_get_position (w, &wx, &wy);
*x += wx;
*y += wy;
}
#endif
if (w == NULL)
{