[gtk+/client-side-windows: 270/284] Only add up native subwindow offsets for gdk_window_quartz_get_origin



commit 97996ff00c727e648b0f8525608d3c6aba295a9c
Author: Richard Hult <richard imendio com>
Date:   Sun Feb 15 09:25:56 2009 +0100

    Only add up native subwindow offsets for gdk_window_quartz_get_origin
---
 gdk/quartz/gdkwindow-quartz.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index f112497..2bb4bdb 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -1678,8 +1678,11 @@ gdk_window_quartz_get_origin (GdkWindow *window,
 
   if (window == _gdk_root)
     {
-      *x = 0;
-      *y = 0;
+      if (x)
+        *x = 0;
+      if (y)
+        *y = 0;
+
       return 1;
     }
   
@@ -1695,8 +1698,11 @@ gdk_window_quartz_get_origin (GdkWindow *window,
 
   while (private != GDK_WINDOW_OBJECT (toplevel))
     {
-      tmp_x += private->x;
-      tmp_y += private->y;
+      if (_gdk_window_has_impl ((GdkWindow *)private))
+        {
+          tmp_x += private->x;
+          tmp_y += private->y;
+        }
 
       private = private->parent;
     }



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