[Tizen] Prevent embedding a11y tree if a widget is paused 58/318258/2
authorYoungsun Suh <youngsun.suh@samsung.com>
Thu, 26 Sep 2024 01:11:37 +0000 (10:11 +0900)
committerYoungsun Suh <youngsun.suh@samsung.com>
Thu, 26 Sep 2024 06:14:30 +0000 (06:14 +0000)
Change-Id: I71f8b015f6e381da4555d30c56a9712afbd2a9a3

widget_viewer_dali/internal/widget_view/widget_view_impl.cpp
widget_viewer_dali/internal/widget_view/widget_view_impl.h

index 926193cac7f948f65d00b6038f9b3bd01561eb74..b1b80b0dc0b6379c8a12f315f0efbe01aa06a990 100644 (file)
@@ -313,6 +313,11 @@ bool WidgetView::PauseWidgetInternally()
      return false;
   }
 
+  if(Dali::Accessibility::IsUp())
+  {
+    GetAccessibleObject()->OnChildrenChanged();
+  }
+
   DALI_LOG_RELEASE_INFO("WidgetView::PauseWidget: Widget is paused (%s, %s) [%p]\n", mWidgetId.c_str(), mInstanceId.c_str(), this );
 
   return true;
@@ -337,6 +342,11 @@ bool WidgetView::ResumeWidgetInternally()
      return false;
   }
 
+  if(Dali::Accessibility::IsUp())
+  {
+    GetAccessibleObject()->OnChildrenChanged();
+  }
+
   DALI_LOG_RELEASE_INFO("WidgetView::ResumeWidget: Widget is resumed (%s, %s) [%p]\n", mWidgetId.c_str(), mInstanceId.c_str(), this );
 
   return true;
@@ -1222,7 +1232,7 @@ void WidgetView::OnUpdateArea( Dali::PropertyNotification& source )
     mPaused = needPaused;
   }
 
-  if(!mPaused)
+  if(!mPaused && Dali::Accessibility::IsUp())
   {
     auto accessible = std::dynamic_pointer_cast<WidgetView::WidgetViewAccessible>(GetAccessibleObject());
     DALI_ASSERT_DEBUG(accessible);
@@ -1853,6 +1863,11 @@ void WidgetView::UpdateBuffer( struct tizen_remote_surface *surface, struct wl_b
   mRemoteSurface = surface;
 }
 
+bool WidgetView::IsPaused() const
+{
+  return mPaused;
+}
+
 bool WidgetView::LaunchWidget()
 {
   screen_connector_toolkit_ops ops;
@@ -2061,6 +2076,12 @@ void WidgetView::WidgetViewAccessible::DoGetChildren(std::vector<Dali::Accessibi
 
   auto        self       = Dali::WidgetView::WidgetView::DownCast(Self());
   auto&       selfImpl   = Dali::WidgetView::GetImplementation(self);
+  if(selfImpl.IsPaused())
+  {
+    DALI_LOG_RELEASE_INFO("Returning no children as the widget is paused.");
+    return;
+  }
+
   const auto& instanceId = selfImpl.GetInstanceId();
   int         pid        = selfImpl.GetPid();
   std::string busName    = Bridge::MakeBusNameForWidget(instanceId, pid);
index bf0d0e5df656b5b34a97e31c9cc2695b684e5147..af11b960f3e7f4ad3b61eba11535b3657167f968 100644 (file)
@@ -322,6 +322,8 @@ public: // Internal API
    */
   void UpdateBuffer( struct tizen_remote_surface *surface, struct wl_buffer *buffer, int32_t fd);
 
+  bool IsPaused() const;
+
 public: // Internal API for WidgetViewManager
 
   /**