[gtk+] gdkwindow: Call function instead of copying its code



commit e9aa5a9822e6c0344ca2639f0d160702b4a855dd
Author: Benjamin Otte <otte redhat com>
Date:   Fri Feb 28 03:07:18 2014 +0100

    gdkwindow: Call function instead of copying its code
    
    gdk_window_get_origin() is just a variant of
    gdk_window_get_root_coords() after all.

 gdk/gdkwindow.c |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)
---
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 1a22cd7..17c6d09 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -6135,24 +6135,14 @@ gdk_window_get_origin (GdkWindow *window,
                       gint      *x,
                       gint      *y)
 {
-  GdkWindowImplClass *impl_class;
+  gint dummy_x, dummy_y;
 
   g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
 
-  if (GDK_WINDOW_DESTROYED (window))
-    {
-      if (x)
-       *x = 0;
-      if (y)
-       *y = 0;
-      return 0;
-    }
-
-  impl_class = GDK_WINDOW_IMPL_GET_CLASS (window->impl);
-  impl_class->get_root_coords (window->impl_window,
-                              window->abs_x,
-                              window->abs_y,
-                              x, y);
+  gdk_window_get_root_coords (window,
+                              0, 0,
+                              x ? x : &dummy_x,
+                              y ? y : &dummy_y);
 
   return TRUE;
 }


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