From b37d83e98825af0eb3b5e644701b36a24dfd6212 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 9 Apr 2013 11:49:42 +0100 Subject: [PATCH] wayland: don't leave root window values uninitialised Under Wayland we don't know the absolute position of the device but there are some API calls that expect to get an root window position. Previously we were not assigning any value to these out parameters potentially leaving the values undefined. This change returns the current surface relative position of the device. --- gdk/wayland/gdkdevice-wayland.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c index 8cf8447204..c258be3316 100644 --- a/gdk/wayland/gdkdevice-wayland.c +++ b/gdk/wayland/gdkdevice-wayland.c @@ -255,13 +255,11 @@ gdk_wayland_device_query_state (GdkDevice *device, *root_window = gdk_screen_get_root_window (default_screen); if (child_window) *child_window = wd->pointer_focus; - /* Do something clever for relative here */ -#if 0 + /* TODO: Do something clever for relative here */ if (root_x) - *root_x = wd->x; + *root_x = wd->surface_x; if (root_y) - *root_y = wd->y; -#endif + *root_y = wd->surface_y; if (win_x) *win_x = wd->surface_x; if (win_y)