Simplify window purging procedure 24/311824/2 accepted/tizen/7.0/unified/20240529.084009
authorArtur Świgoń <a.swigon@samsung.com>
Tue, 28 May 2024 11:59:38 +0000 (13:59 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Tue, 28 May 2024 12:03:21 +0000 (14:03 +0200)
The checks during window destruction are mostly redundant. Also add a recursion
guard to purge_windows_list.

Change-Id: I90170a145737f742f3c77627da547903f7d8b4c5

src/window_tracker.c

index f439dfbfe30608ae8b5457035150179408419f94..3fc88370d44a361a1f09909e92f4e073426a8431 100644 (file)
@@ -96,25 +96,19 @@ static Eina_Bool _window_need_to_be_purged(WindowInfo *wi)
                DEBUG("purging %p because of defunct state or window doesn't exist", wi->window);
                return EINA_TRUE;
        }
-       AtspiComponent *comp = atspi_accessible_get_component_iface(wi->window);
-       if (!comp) {
-               DEBUG("purging %p because of not component", wi->window);
-               return EINA_TRUE;
-       }
-       GError *err = NULL;
-       AtspiRect *rect = atspi_component_get_extents(comp, ATSPI_COORD_TYPE_SCREEN, &err);
-       g_object_unref(comp);
-       GERROR_CHECK(err);
-       if (!rect) {
-               DEBUG("purging because failed to get extents");
-               return EINA_TRUE;
-       }
-       g_free(rect);
+
        return EINA_FALSE;
 }
 
 static void _purge_windows_list(WindowTrackerData *wtd)
 {
+       static Eina_Bool is_purging = EINA_FALSE;
+
+       if (is_purging)
+               return;
+
+       is_purging = EINA_TRUE;
+
        DEBUG("purging");
        WindowInfo *wi;
        Eina_List *l, *l_prev;
@@ -157,6 +151,8 @@ static void _purge_windows_list(WindowTrackerData *wtd)
                if (!wi_top)
                        app_tracker_null_context_switch(wtd->user_data);
        }
+
+       is_purging = EINA_FALSE;
 }
 
 static bool _window_extents_get(AtspiAccessible *window, AtspiRect *extents)