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.
This commit is contained in:
Alejandro Piñeiro 2010-12-26 00:13:07 +01:00
parent be8c0e4734
commit 1e196b39b8

View File

@ -237,8 +237,11 @@ gail_toplevel_show_event_watcher (GSignalInvocationHint *ihint,
* Add the window to the list & emit the signal. * Add the window to the list & emit the signal.
* Don't do this for tooltips (Bug #150649). * Don't do this for tooltips (Bug #150649).
*/ */
if (atk_object_get_role (child) != ATK_ROLE_TOOL_TIP) if (atk_object_get_role (child) == ATK_ROLE_TOOL_TIP)
{ {
return TRUE;
}
toplevel->window_list = g_list_append (toplevel->window_list, widget); toplevel->window_list = g_list_append (toplevel->window_list, widget);
n_children = g_list_length (toplevel->window_list); n_children = g_list_length (toplevel->window_list);
@ -251,7 +254,6 @@ gail_toplevel_show_event_watcher (GSignalInvocationHint *ihint,
g_signal_emit_by_name (atk_obj, "children-changed::add", g_signal_emit_by_name (atk_obj, "children-changed::add",
n_children - 1, n_children - 1,
child, NULL); child, NULL);
}
/* Connect destroy signal callback */ /* Connect destroy signal callback */
g_signal_connect (G_OBJECT(object), g_signal_connect (G_OBJECT(object),