virtual void WindowUnfocused(Window window) = 0;
/**
+ * @brief Tells the bridge that the application is not running
+ */
+ virtual void ApplicationPaused() = 0;
+
+ /**
+ * @brief Tells the bridge that the application is running
+ */
+ virtual void ApplicationResumed() = 0;
+
+ /**
* @brief Initializes accessibility bus.
*/
virtual void Initialize() = 0;
DBus::DBusClient mDirectReadingClient;
bool mIsScreenReaderEnabled = false;
bool mIsEnabled = false;
+ bool mIsApplicationRunning = false;
std::unordered_map<int32_t, std::function<void(std::string)>> mDirectReadingCallbacks;
Dali::Actor mHighlightedActor;
std::function<void(Dali::Actor)> mHighlightClearAction;
}
/**
+ * @copydoc Dali::Accessibility::Bridge::ApplicationPaused()
+ */
+ void ApplicationPaused() override
+ {
+ mIsApplicationRunning = false;
+ SwitchBridge();
+ }
+
+ /**
+ * @copydoc Dali::Accessibility::Bridge::ApplicationResumed()
+ */
+ void ApplicationResumed() override
+ {
+ mIsApplicationRunning = true;
+ SwitchBridge();
+ }
+
+ /**
* @copydoc Dali::Accessibility::Bridge::SuppressScreenReader()
*/
void SuppressScreenReader(bool suppress) override
void SwitchBridge()
{
- if((!mIsScreenReaderSuppressed && mIsScreenReaderEnabled) || mIsEnabled)
+ bool isScreenReaderEnabled = mIsScreenReaderEnabled && !mIsScreenReaderSuppressed;
+
+ if((isScreenReaderEnabled || mIsEnabled) && mIsApplicationRunning)
{
ForceUp();
}
void Application::OnPause()
{
+ Accessibility::Bridge::GetCurrentBridge()->ApplicationPaused();
+
// A DALi app should handle Pause/Resume events.
// DALi just delivers the framework Pause event to the application, but not actually pause DALi core.
// Pausing DALi core only occurs on the Window Hidden framework event
void Application::OnResume()
{
+ Accessibility::Bridge::GetCurrentBridge()->ApplicationResumed();
+
// Emit the signal first so the application can queue any messages before we do an update/render
// This ensures we do not just redraw the last frame before pausing if that's not required
Dali::Application application(this);