static Eina_Bool _window_need_to_be_purged(WindowInfo *wi)
{
- if (!wi->window || object_has_defunct_state(wi->window)) {
+ if (!wi->window || wi->defunct || object_has_defunct_state(wi->window)) {
DEBUG("purging %p because of defunct state or window doesn't exist", wi->window);
return EINA_TRUE;
}
static void
_remove_window_under_bus(WindowTrackerData *wtd, const char *bus)
{
+ // We're called from a D-Bus filter, so let's only set a flag in order not to re-enter D-Bus.
DEBUG("START");
- Eina_List *window_list = NULL;
Eina_List *l;
WindowInfo *wi;
gchar *bus_name = NULL;
- AtspiAccessible *window;
EINA_LIST_FOREACH(wtd->window_infos, l, wi) {
if (!wi) continue;
- bus_name = atspi_accessible_get_bus_name(wi->window, NULL);
- if (is_same_str(bus, bus_name)) {
- /* We need to call g_object_ref(), becasue window can be disposed in _window_remove()
- if it is called at this function. We can check it is disposed by following lines.
- g_object_add_weak_pointer (G_OBJECT(window), (gpointer *)&window);
- g_object_unref(window);
- DEBUG("%p", window); // this shows (nil) */
- window_list = eina_list_append(window_list, g_object_ref(wi->window));
- }
+ bus_name = atspi_accessible_get_bus_name(wi->window, NULL); // No D-Bus call
+ if (is_same_str(bus, bus_name))
+ wi->defunct = EINA_TRUE;
g_free(bus_name);
}
- EINA_LIST_FREE(window_list, window) {
- _window_remove(wtd, window);
- g_object_unref(window);
- }
DEBUG("END");
}
{
return wtd ? wtd->top_win : NULL;
}
-
-