[AT-SPI] Suppress some events in Widget windows 86/277486/2
authorArtur Świgoń <a.swigon@samsung.com>
Thu, 7 Jul 2022 10:54:38 +0000 (12:54 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Thu, 7 Jul 2022 15:58:41 +0000 (17:58 +0200)
While the Widget is technically a window in DALi, it should not be seen
as a window by AT clients such as the Screen Reader, i.e. it should not
grab and narrow down the navigation context. Suppressing window events
and some state events (notably, State::SHOWING, however the API offers
an all-or-nothing granularity only) is necessary to achieve this goal.

Change-Id: I0873751f025bbdd321aa26444c070bf064c0ce3f

dali/internal/system/tizen-wayland/widget-controller-tizen.cpp

index 0f762bb..5e03ef1 100644 (file)
 #include <dali/internal/system/tizen-wayland/widget-controller-tizen.h>
 
 // EXTERNAL INCLUDES
+#include <dali/public-api/actors/layer.h>
 #include <bundle.h>
 #include <widget_base.h>
 
 // INTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/accessibility-bridge.h>
+#include <dali/devel-api/atspi-interfaces/accessible.h>
 
 namespace Dali
 {
@@ -75,6 +77,11 @@ void WidgetImplTizen::SetInformation(Dali::Window window, const std::string& wid
 
   auto preferredBusName = Bridge::MakeBusNameForWidget(widgetId);
   Bridge::GetCurrentBridge()->SetPreferredBusName(preferredBusName);
+
+  // Widget should not send window events (which could narrow down the navigation context)
+  auto& suppressedEvents = Accessibility::Accessible::Get(window.GetRootLayer())->GetSuppressedEvents();
+  suppressedEvents[Accessibility::AtspiEvent::STATE_CHANGED] = true;
+  suppressedEvents[Accessibility::AtspiEvent::WINDOW_CHANGED] = true;
 }
 
 Dali::Window WidgetImplTizen::GetWindow() const