Fix perf regression when efl page_tab is showing 76/324576/1 accepted/tizen/7.0/unified/20250521.083035
authorYoungsun Suh <youngsun.suh@samsung.com>
Tue, 20 May 2025 23:56:35 +0000 (08:56 +0900)
committerYoungsun Suh <youngsun.suh@samsung.com>
Tue, 20 May 2025 23:56:35 +0000 (08:56 +0900)
Change-Id: I130f254c8d7a50cfd471ecd96b0927850c1c9bac

include/utils.h
src/app_tracker.c
src/reading_composer.c
src/utils.c

index bbe0128a2d0e180277d11b02d44bb508cc905431..4e405f8e6d1f49eef7db109ac8cc64ba74352feb 100644 (file)
@@ -141,7 +141,6 @@ Eina_Bool object_has_focused_state(AtspiAccessible *obj);
 Eina_Bool object_has_defunct_state(AtspiAccessible *obj);
 Eina_Bool object_has_highlighted_state(AtspiAccessible *obj);
 Eina_Bool object_get_extents(AtspiAccessible *object, AtspiRect *extents);
-Eina_Bool is_legacy_toolkit(AtspiAccessible *obj);
 
 int get_percent_value(double value, double lower, double upper);
 
@@ -149,6 +148,7 @@ Eina_Bool is_same_str (const char *s1, const char *s2);
 Eina_Bool rect_contains(const AtspiRect *rect, int x, int y);
 
 Live_Region_Politeness try_parse_politeness(GHashTable *attrs, Eina_Bool assertive_by_default);
+Eina_Bool has_legacy_elm_type(AtspiAccessible *obj);
 
 static inline void ESAL(Eina_Strbuf *buf, const char *txt)
 {
index 26f9eeefbbdec231755120846378b86ef87d65d7..bca57eaf2c2b847b626bfd2951e83b85b1799b57 100644 (file)
@@ -328,7 +328,7 @@ static void _on_atspi_event_cb(AtspiEvent *event, void *user_data)
                                DEBUG("Append Window");
                                window_tracker_window_append(atd->window_tracker_data, event->source, EINA_FALSE);
                        } else if (role == ATSPI_ROLE_PAGE_TAB) {
-                               if (is_legacy_toolkit(event->source)) {
+                               if (has_legacy_elm_type(event->source)) {
                                        // EFL only: refresh default label for newly showing page tab
                                        DEBUG("Refreshing TAB");
                                        timer_reschedule(atd);
index ca4a25da8657384a032e22e1e839c07d16161f89..1c5251d8647f8dea5461e8cc4fc5c254651fb9d9 100644 (file)
@@ -232,7 +232,7 @@ TIZEN_PROD_STATIC char *generate_state_trait_from_role(AtspiAccessibleReadingMat
        }
        case ATSPI_ROLE_PAGE_TAB: {
                AtspiAccessible *parent = rm->parent;
-               if (!parent || is_legacy_toolkit(rm->self)) break;
+               if (!parent || has_legacy_elm_type(rm->self)) break;
 
                AtspiRole parent_role = rm->parent_role;
                if (parent_role == ATSPI_ROLE_PAGE_TAB_LIST) {
@@ -376,7 +376,7 @@ TIZEN_PROD_STATIC char *generate_description_trait(AtspiAccessibleReadingMateria
        }
        case ATSPI_ROLE_PAGE_TAB: {
                AtspiAccessible *parent = rm->parent;
-               if (!parent || is_legacy_toolkit(rm->self)) break;
+               if (!parent || has_legacy_elm_type(rm->self)) break;
 
                AtspiRole parent_role = rm->parent_role;
                if (parent_role == ATSPI_ROLE_PAGE_TAB_LIST) {
index 4bd2531e119976c38be09fecde09cdf84c34d9a4..e3537863e0839933881b5b612c30054f96c660ca 100644 (file)
@@ -252,23 +252,6 @@ Eina_Bool object_has_highlighted_state(AtspiAccessible *obj)
        return _object_has_state(obj, ATSPI_STATE_HIGHLIGHTED);
 }
 
-Eina_Bool is_legacy_toolkit(AtspiAccessible *obj) {
-       Eina_Bool ret = EINA_FALSE;
-       AtspiAccessible *app = atspi_accessible_get_application(obj, NULL);
-       if (app) {
-               gchar* toolkit_name = atspi_accessible_get_toolkit_name(app, NULL);
-               if (toolkit_name) {
-                       if (g_str_equal(toolkit_name, "elementary")) {
-                               ret = EINA_TRUE;
-                       }
-                       g_free(toolkit_name);
-               }
-               g_object_unref(app);
-       }
-       DEBUG("is_legacy_toolkit=%d", ret);
-       return ret;
-}
-
 int get_percent_value(double value, double lower, double upper)
 {
        double add_for_rounding = 0.5f;
@@ -338,3 +321,20 @@ Live_Region_Politeness try_parse_politeness(GHashTable *attrs, Eina_Bool asserti
        DEBUG("speaking politeness mode is %d", mode);
        return mode;
 }
+
+Eina_Bool has_legacy_elm_type(AtspiAccessible *obj)
+{
+       Eina_Bool ret = EINA_FALSE;
+       GHashTable *attrs = atspi_accessible_get_attributes(obj, NULL);
+       if (attrs) {
+               const char *val = g_hash_table_lookup(attrs, "type");
+               if (val) {
+                       DEBUG("type attr is '%s'", val);
+                       if (g_strcmp0(val, "Elm_Layout") == 0 || g_strcmp0(val, "Eext.Sidenavi") == 0) ret = EINA_TRUE;
+               }
+
+               if (attrs) g_hash_table_unref(attrs);
+       }
+
+       return ret;
+}