[AT-SPI] Call Control::Impl::AccessibilityRegister() unconditionally 88/257188/4
authorArtur Świgoń <a.swigon@samsung.com>
Tue, 20 Apr 2021 18:26:44 +0000 (20:26 +0200)
committerArtur Świgoń <a.swigon@samsung.com>
Tue, 11 May 2021 09:13:53 +0000 (09:13 +0000)
This patch fixes a bug where the screen reader is not notified about
changes of size / position / visibility of controls if accessibility is
enabled in runtime, i.e. after the controls are connected to the scene.

Please note that the callbacks registered with AccessibilityRegister()
already check Accessibility::IsUp(), therefore non-accessibility usage
scenarios are not affected by this patch.

Change-Id: Icc49b0a12a75135ca3d2033b342878b4ab1392bb

dali-toolkit/internal/controls/control/control-data-impl.cpp
dali-toolkit/public-api/controls/control-impl.cpp

index 4e2a1c6..9e69f95 100644 (file)
@@ -487,7 +487,6 @@ Control::Impl::~Impl()
     StopObservingVisual(iter->visual);
   }
 
-  AccessibilityDeregister(false);
   // All gesture detectors will be destroyed so no need to disconnect.
   delete mStartingPinchScale;
 
index 8a4b9c8..781b531 100644 (file)
@@ -494,9 +494,6 @@ void Control::Initialize()
     auto typeName = type.GetName();
     DevelControl::AppendAccessibilityAttribute(Self(), "class", typeName);
   }
-
-  if(Accessibility::IsUp())
-    mImpl->AccessibilityRegister();
 }
 
 void Control::OnInitialize()
@@ -593,20 +590,12 @@ void Control::OnSceneConnection(int depth)
   // The clipping renderer is only created if required.
   CreateClippingRenderer(*this);
 
-  // Request to be laid out when the control is connected to the Scene.
-  // Signal that a Relayout may be needed
-  if(Accessibility::IsUp())
-  {
-    mImpl->AccessibilityRegister();
-  }
+  mImpl->AccessibilityRegister();
 }
 
 void Control::OnSceneDisconnection()
 {
-  if(Accessibility::IsUp())
-  {
-    mImpl->AccessibilityDeregister(true);
-  }
+  mImpl->AccessibilityDeregister(true);
   mImpl->OnSceneDisconnection();
 }