libaurum: apply pkg name for accesible node 85/256685/2
authorHosang Kim <hosang12.kim@samsung.com>
Fri, 9 Apr 2021 07:29:50 +0000 (16:29 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Fri, 9 Apr 2021 07:32:47 +0000 (16:32 +0900)
Change-Id: Iba4cbbaa72b3d03b81ff6a964d2d617e3b69c1e6

libaurum/src/Impl/Accessibility/AtspiAccessibleNode.cc

index f506502..2cf3fe1 100644 (file)
@@ -173,9 +173,20 @@ void AtspiAccessibleNode::refresh()
     #endif
 
         gchar *name = AtspiWrapper::Atspi_accessible_get_name(mNode, NULL);
-        mText = name;
-        mPkg = name;
-        g_free(name);
+        if (name) {
+            mText = name;
+            g_free(name);
+        }
+
+        AtspiAccessible *app = AtspiWrapper::Atspi_accessible_get_application(mNode, NULL);
+        if (app) {
+            gchar *pkg = AtspiWrapper::Atspi_accessible_get_name(app, NULL);
+            if (pkg) {
+                mPkg = pkg;
+                g_free(pkg);
+            }
+            g_object_unref(app);
+        }
 
         GHashTable *attributes = AtspiWrapper::Atspi_accessible_get_attributes(mNode, NULL);
         if (attributes) {