[gtk+/broadway: 228/246] broadway: Fix some window coordinate reporting issues



commit 7d2ff79ddfe08fc36d56ef41fb9678cb71119d72
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Mar 14 11:22:12 2011 +0100

    broadway: Fix some window coordinate reporting issues

 gdk/broadway/gdkwindow-broadway.c |   45 ++++++++++++++++++++++++++++++------
 1 files changed, 37 insertions(+), 8 deletions(-)
---
diff --git a/gdk/broadway/gdkwindow-broadway.c b/gdk/broadway/gdkwindow-broadway.c
index 9690411..3a722ef 100644
--- a/gdk/broadway/gdkwindow-broadway.c
+++ b/gdk/broadway/gdkwindow-broadway.c
@@ -812,19 +812,40 @@ gdk_window_broadway_get_geometry (GdkWindow *window,
 				  gint      *width,
 				  gint      *height)
 {
+  GdkWindowImplBroadway *impl;
+
+  g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+
+  impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+
+  /* TODO: These should really roundtrip to the client to get the current data */
+
+  if (x)
+    *x = impl->wrapper->x;
+  if (y)
+    *y = impl->wrapper->y;
+  if (width)
+    *width = impl->wrapper->width;
+  if (height)
+    *height = impl->wrapper->height;
+
 }
 
 static gint
 gdk_window_broadway_get_root_coords (GdkWindow *window,
-				gint       x,
-				gint       y,
-				gint      *root_x,
-				gint      *root_y)
+				     gint       x,
+				     gint       y,
+				     gint      *root_x,
+				     gint      *root_y)
 {
+  GdkWindowImplBroadway *impl;
+
+  impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+
   if (root_x)
-    *root_x = x;
+    *root_x = x + impl->wrapper->x;
   if (root_y)
-    *root_y = y;
+    *root_y = y + impl->wrapper->y;
 
   return 1;
 }
@@ -834,11 +855,17 @@ gdk_broadway_window_get_root_origin (GdkWindow *window,
 				     gint      *x,
 				     gint      *y)
 {
+  GdkWindowImplBroadway *impl;
+
+  impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
+
+  /* TODO: This should take wm frame into account */
+
   if (x)
-    *x = 0;
+    *x = impl->wrapper->x;
 
   if (y)
-    *y = 0;
+    *y = impl->wrapper->x;
 }
 
 static void
@@ -847,6 +874,8 @@ gdk_broadway_window_get_frame_extents (GdkWindow    *window,
 {
   g_return_if_fail (rect != NULL);
 
+  /* TODO: This should take wm frame into account */
+
   rect->x = window->x;
   rect->y = window->y;
   rect->width = window->width;



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