[gtk+] wayland: don't leave root window values uninitialised



commit b37d83e98825af0eb3b5e644701b36a24dfd6212
Author: Rob Bradford <rob linux intel com>
Date:   Tue Apr 9 11:49:42 2013 +0100

    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 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 8cf8447..c258be3 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)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]