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.
};
-/* 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)
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) {