[Tizen] Handle accessibility behavior according to window focus change 96/280396/1
authorSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 29 Aug 2022 11:13:24 +0000 (20:13 +0900)
committerSeoyeon Kim <seoyeon2.kim@samsung.com>
Mon, 29 Aug 2022 11:15:10 +0000 (20:15 +0900)
- When the window lost the focus, accessibility should be disabled.
 Otherwise, it gained the focus, accessibility should be enabled again.
- Add to control accessibility enabled behavior in OnFocusChanged

Change-Id: I7b6e24b444b952b8791c279f37c20444ac7aec3e
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
dali/internal/window-system/common/event-handler.cpp

index be4f3f40b53ac5728bd5ed3011d443981e75629d..4f19a8ba2deade5f78c086f04fc1aeb524085ea2 100755 (executable)
@@ -186,6 +186,19 @@ void EventHandler::OnFocusChanged( bool focusIn )
     {
       clipboard.HideClipboard();
     }
+
+#ifdef DALI_ELDBUS_AVAILABLE
+    // When dali window gains the focus, Accessibility should be enabled.
+    if ( mAccessibilityAdaptor )
+    {
+      AccessibilityAdaptor* accessibilityAdaptor( &AccessibilityAdaptor::GetImplementation( mAccessibilityAdaptor ) );
+      if ( accessibilityAdaptor )
+      {
+        DALI_LOG_INFO( gSelectionEventLogFilter, Debug::General, "OnFocusChanged: EnableAccessibility \n" );
+        accessibilityAdaptor->EnableAccessibility();
+      }
+    }
+#endif
   }
   else
   {
@@ -196,6 +209,19 @@ void EventHandler::OnFocusChanged( bool focusIn )
       Clipboard& clipBoardImpl( GetImplementation( clipboard ) );
       clipBoardImpl.HideClipboard(true);
     }
+
+#ifdef DALI_ELDBUS_AVAILABLE
+    // When dali window loses the focus, Accessibility should be disabled.
+    if ( mAccessibilityAdaptor )
+    {
+      AccessibilityAdaptor* accessibilityAdaptor( &AccessibilityAdaptor::GetImplementation( mAccessibilityAdaptor ) );
+      if ( accessibilityAdaptor && accessibilityAdaptor->IsEnabled() )
+      {
+        DALI_LOG_INFO( gSelectionEventLogFilter, Debug::General, "OnFocusChanged: DisableAccessibility \n" );
+        accessibilityAdaptor->DisableAccessibility();
+      }
+    }
+#endif
   }
 }