libaurum: add checking visibility of input window. 67/311067/1
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 13 May 2024 12:02:56 +0000 (21:02 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Mon, 13 May 2024 12:02:56 +0000 (21:02 +0900)
Input window(like as keyboard) is always activated.
So we can't know input window is showing actually.

Change-Id: I8b01fdf38b05ba49cb1ad645f1179eb884219f49

libaurum/src/Impl/Accessibility/AtspiAccessibleWatcher.cc

index eef77e116d8861579d248de8ac4ffdf42788b2da..ffaa7b51777306043931391be087e65020bbd74e 100644 (file)
@@ -399,6 +399,16 @@ void AtspiAccessibleWatcher::onAtspiEvents(AtspiEvent *event, void *watcher)
         return;
     }
 
+    if (!strncmp(event->type, "object:state-changed:visible", 28))
+    {
+        char *role = AtspiWrapper::Atspi_accessible_get_role_name(event->source, NULL);
+        if (!strncmp(role, "input method window", 19))
+        {
+            isWindowEventEmitted = true;
+        }
+        free(role);
+    }
+
     if (!strncmp(event->type, "w", 1))
     {
         isWindowEventEmitted = true;