[AT-SPI] Fix not working screen reader when rerunning it
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / window-impl.cpp
index cd060f0..f6c4c62 100644 (file)
@@ -92,7 +92,8 @@ Window::Window()
   mResizeSignal(),
   mVisibilityChangedSignal(),
   mTransitionEffectEventSignal(),
-  mKeyboardRepeatSettingsChangedSignal()
+  mKeyboardRepeatSettingsChangedSignal(),
+  mAuxiliaryMessageSignal()
 {
 }
 
@@ -100,7 +101,7 @@ Window::~Window()
 {
   auto bridge     = Accessibility::Bridge::GetCurrentBridge();
   auto rootLayer  = mScene.GetRootLayer();
-  auto accessible = Accessibility::Accessible::Get(rootLayer);
+  auto accessible = Accessibility::Accessible::Get(rootLayer, true);
   bridge->RemoveTopLevelWindow(accessible);
 
   if(mAdaptor)
@@ -142,6 +143,7 @@ void Window::Initialize(Any surface, const PositionSize& positionSize, const std
   mWindowBase->KeyboardRepeatSettingsChangedSignal().Connect(this, &Window::OnKeyboardRepeatSettingsChanged);
   mWindowBase->WindowRedrawRequestSignal().Connect(this, &Window::OnWindowRedrawRequest);
   mWindowBase->UpdatePositionSizeSignal().Connect(this, &Window::OnUpdatePositionSize);
+  mWindowBase->AuxiliaryMessageSignal().Connect(this, &Window::OnAuxiliaryMessage);
 
   mWindowSurface->OutputTransformedSignal().Connect(this, &Window::OnOutputTransformed);
 
@@ -177,6 +179,9 @@ void Window::OnAdaptorSet(Dali::Adaptor& adaptor)
   auto accessible = Accessibility::Accessible::Get(rootLayer, true);
   bridge->AddTopLevelWindow(accessible);
 
+  bridge->EnabledSignal().Connect(this, &Window::OnAccessibilityEnabled);
+  bridge->DisabledSignal().Connect(this, &Window::OnAccessibilityDisabled);
+
   // If you call the 'Show' before creating the adaptor, the application cannot know the app resource id.
   // The show must be called after the adaptor is initialized.
   Show();
@@ -858,6 +863,27 @@ void Window::OnResume()
   mSurface->SetFullSwapNextFrame();
 }
 
+void Window::OnAuxiliaryMessage(const std::string& key, const std::string& value, const Property::Array& options)
+{
+  mAuxiliaryMessageSignal.Emit(key, value, options);
+}
+
+void Window::OnAccessibilityEnabled()
+{
+  auto bridge     = Accessibility::Bridge::GetCurrentBridge();
+  auto rootLayer  = mScene.GetRootLayer();
+  auto accessible = Accessibility::Accessible::Get(rootLayer, true);
+  bridge->AddTopLevelWindow(accessible);
+}
+
+void Window::OnAccessibilityDisabled()
+{
+  auto bridge     = Accessibility::Bridge::GetCurrentBridge();
+  auto rootLayer  = mScene.GetRootLayer();
+  auto accessible = Accessibility::Accessible::Get(rootLayer, true);
+  bridge->RemoveTopLevelWindow(accessible);
+}
+
 void Window::RecalculateTouchPosition(Integration::Point& point)
 {
   Vector2 position = point.GetScreenPosition();
@@ -1084,6 +1110,11 @@ void Window::SendRotationCompletedAcknowledgement()
   }
 }
 
+bool Window::IsWindowRotating() const
+{
+  return mWindowSurface->IsWindowRotating();
+}
+
 } // namespace Adaptor
 
 } // namespace Internal