Improved performance, we now do not go to the X server in order to get the list of...
authorAlejandro G. Castro <alex@igalia.com>
Tue, 20 May 2008 12:18:46 +0000 (12:18 +0000)
committerAlejandro G. Castro <alex@igalia.com>
Tue, 20 May 2008 12:18:46 +0000 (12:18 +0000)
* src/hildon-pannable-area.c:
(get_ordered_children): Removed this function.
(hildon_pannable_area_get_topmost): Replaced the ad-hoc search of
the children windows function with gdk_window_get_children.

ChangeLog
src/hildon-pannable-area.c

index daf6fad..faefcc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
 2008-05-20 Alejandro G. Castro <alex@igalia.com>
 
+       Improved performance, we now do not go to the X server in order to
+       get the list of window children. Apparently the effect is the
+       same, we have to be careful and check if this breaks something in
+       any corner case.
+       
+       * src/hildon-pannable-area.c:
+       (get_ordered_children): Removed this function.
+       (hildon_pannable_area_get_topmost): Replaced the ad-hoc search of
+       the children windows function with gdk_window_get_children.
+       
+2008-05-20 Alejandro G. Castro <alex@igalia.com>
+
        * src/hildon-pannable-area.c:
        (hildon_pannable_area_dispose): Fixed a crash when closing the
        window and kinetics is activated.
index 5884754..9e43078 100644 (file)
@@ -107,30 +107,6 @@ enum {
 
 };
 
-/* Following function inherited from libhildondesktop */
-static GList *
-get_ordered_children                            (GdkWindow *window)
-{
-    Window      *children, root, parent;
-    guint        i, n_children = 0;
-    GList        *ret = NULL;
-
-    gdk_error_trap_push ();
-    XQueryTree (GDK_DISPLAY (), GDK_WINDOW_XID (window), &root,
-               &parent, &children, &n_children);
-
-    if (gdk_error_trap_pop ()) return NULL;
-
-    for (i = 0; i < n_children; i++) {
-        GdkWindow *window = gdk_window_lookup (children[i]);
-        if (window) ret = g_list_append (ret, window);
-    }
-
-    XFree (children);
-
-    return ret;
-}
-
 static GdkWindow *
 hildon_pannable_area_get_topmost                (GdkWindow *window, gint x, gint y,
                                                  gint *tx, gint *ty)
@@ -148,7 +124,7 @@ hildon_pannable_area_get_topmost                (GdkWindow *window, gint x, gint
 
     while (window) {
         gint child_x = 0, child_y = 0;
-        GList *c, *children = get_ordered_children (window);
+        GList *c, *children = gdk_window_get_children (window);
         GdkWindow *old_window = window;
 
         for (c = children; c; c = c->next) {