/**
* @brief Re-enables auto-initialization of AT-SPI bridge
*
- * @param topLevelWindow Accessible object for Scene::GetRootLayer()
- * @param applicationName Application name
- *
* Normal applications do not have to call this function. GetCurrentBridge() tries to
* initialize the AT-SPI bridge when it is called for the first time.
*
* @see Dali::Accessibility::Bridge::AddTopLevelWindow
* @see Dali::Accessibility::Bridge::SetApplicationName
*/
- static void EnableAutoInit(Accessible* topLevelWindow, const std::string& applicationName);
+ static void EnableAutoInit();
protected:
struct Data
// CLASS HEADER
// EXTERNAL INCLUDES
+#include <dali/public-api/actors/layer.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/integration-api/debug.h>
#include <iostream>
#include <unordered_map>
#include <dali/internal/accessibility/bridge/bridge-text.h>
#include <dali/internal/accessibility/bridge/bridge-value.h>
#include <dali/internal/accessibility/bridge/dummy-atspi.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
#include <dali/internal/system/common/environment-variables.h>
#include <dali/devel-api/adaptor-framework/environment-variable.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
using namespace Dali::Accessibility;
autoInitState = AutoInitState::DISABLED;
}
-void Bridge::EnableAutoInit(Accessible* topLevelWindow, const std::string& applicationName)
+void Bridge::EnableAutoInit()
{
autoInitState = AutoInitState::ENABLED;
return;
}
+ auto rootLayer = Dali::Stage::GetCurrent().GetRootLayer();
+ auto window = Dali::DevelWindow::Get(rootLayer);
+ auto applicationName = Dali::Internal::Adaptor::Adaptor::GetApplicationPackageName();
+
auto* bridge = Bridge::GetCurrentBridge();
- bridge->AddTopLevelWindow(topLevelWindow);
+ bridge->AddTopLevelWindow(Dali::Accessibility::Accessible::Get(rootLayer, true));
bridge->SetApplicationName(applicationName);
bridge->Initialize();
+
+ if(window && window.IsVisible())
+ {
+ bridge->ApplicationShown();
+ }
}