From 3ef31e4cc82e57b29aa3d682d0ab6df08a8bb19e Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sun, 23 Jan 2011 00:30:58 +0100 Subject: [PATCH] libgimpwidgets: use new GdkWindow API only when available --- libgimpwidgets/gimpruler.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/libgimpwidgets/gimpruler.c b/libgimpwidgets/gimpruler.c index d168371305..8d3e22ef11 100644 --- a/libgimpwidgets/gimpruler.c +++ b/libgimpwidgets/gimpruler.c @@ -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) {