From 0320c3be8e2be4f1d7c2b2465089e71fd43d8b53 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 17 Mar 2014 15:27:13 -0400 Subject: [PATCH] wayland: Fix "fake root" coords We were incorrectly summing up our own window over and over rather than the coordinates of the parent windows. --- gdk/wayland/gdkwindow-wayland.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/gdk/wayland/gdkwindow-wayland.c b/gdk/wayland/gdkwindow-wayland.c index 9e4c07e1c4..b6d3811a73 100644 --- a/gdk/wayland/gdkwindow-wayland.c +++ b/gdk/wayland/gdkwindow-wayland.c @@ -1098,21 +1098,17 @@ gdk_wayland_window_get_fake_root_coords (GdkWindow *window, gint *x_out, gint *y_out) { - GdkWindowImplWayland *impl, *parent_impl; - GdkWindow *parent_window; gint x_offset = 0, y_offset = 0; - impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); - - parent_window = impl->transient_for; - while (parent_window) + while (window) { - parent_impl = GDK_WINDOW_IMPL_WAYLAND (parent_window->impl); + GdkWindowImplWayland *impl; x_offset += window->x; y_offset += window->y; - parent_window = parent_impl->transient_for; + impl = GDK_WINDOW_IMPL_WAYLAND (window->impl); + window = impl->transient_for; } *x_out = x_offset;