[gtk+] [gail] Proper connection to a toplevel window destroy signal
- From: Alejandro Piñeiro Iglesias <apinheiro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] [gail] Proper connection to a toplevel window destroy signal
- Date: Mon, 27 Dec 2010 15:23:19 +0000 (UTC)
commit e1029b907c862435b0464b7105b22582a4fb25c8
Author: Alejandro Piñeiro <apinheiro igalia com>
Date: Sun Dec 26 00:13:07 2010 +0100
[gail] Proper connection to a toplevel window destroy signal
Only connect to the destroy of a toplevel window if it was
really added to the toplevel list of windows.
The destroy callback was added to remove the window from
the toplevel list. The callback doesn't cause a error,
but would iterate on the toplevel list without success.
modules/other/gail/gailtoplevel.c | 32 +++++++++++++++++---------------
1 files changed, 17 insertions(+), 15 deletions(-)
---
diff --git a/modules/other/gail/gailtoplevel.c b/modules/other/gail/gailtoplevel.c
index 6205a42..f998a70 100644
--- a/modules/other/gail/gailtoplevel.c
+++ b/modules/other/gail/gailtoplevel.c
@@ -235,21 +235,23 @@ gail_toplevel_show_event_watcher (GSignalInvocationHint *ihint,
* Add the window to the list & emit the signal.
* Don't do this for tooltips (Bug #150649).
*/
- if (atk_object_get_role (child) != ATK_ROLE_TOOL_TIP)
- {
- toplevel->window_list = g_list_append (toplevel->window_list, widget);
-
- n_children = g_list_length (toplevel->window_list);
-
- /*
- * Must subtract 1 from the n_children since the index is 0-based
- * but g_list_length is 1-based.
- */
- atk_object_set_parent (child, atk_obj);
- g_signal_emit_by_name (atk_obj, "children-changed::add",
- n_children - 1,
- child, NULL);
- }
+ if (atk_object_get_role (child) == ATK_ROLE_TOOL_TIP)
+ {
+ return TRUE;
+ }
+
+ toplevel->window_list = g_list_append (toplevel->window_list, widget);
+
+ n_children = g_list_length (toplevel->window_list);
+
+ /*
+ * Must subtract 1 from the n_children since the index is 0-based
+ * but g_list_length is 1-based.
+ */
+ atk_object_set_parent (child, atk_obj);
+ g_signal_emit_by_name (atk_obj, "children-changed::add",
+ n_children - 1,
+ child, NULL);
/* Connect destroy signal callback */
g_signal_connect (G_OBJECT(object),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]