libgimpwidgets: use new GdkWindow API only when available
This commit is contained in:
parent
33479c1086
commit
3ef31e4cc8
1 changed files with 10 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue