From 7fac651ffa7f33f221e7cfdc7f500b90daed92b0 Mon Sep 17 00:00:00 2001 From: "Alejandro G. Castro" Date: Tue, 20 May 2008 12:18:46 +0000 Subject: [PATCH] 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. --- ChangeLog | 12 ++++++++++++ src/hildon-pannable-area.c | 26 +------------------------- 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index daf6fad..faefcc9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,17 @@ 2008-05-20 Alejandro G. Castro + 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 + * src/hildon-pannable-area.c: (hildon_pannable_area_dispose): Fixed a crash when closing the window and kinetics is activated. diff --git a/src/hildon-pannable-area.c b/src/hildon-pannable-area.c index 5884754..9e43078 100644 --- a/src/hildon-pannable-area.c +++ b/src/hildon-pannable-area.c @@ -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) { -- 1.7.9.5