[Tizen] Reset to "Supports to change the window layer to the bottom" 00/319000/1
authorEunki Hong <eunkiki.hong@samsung.com>
Sat, 12 Oct 2024 01:19:33 +0000 (10:19 +0900)
committerEunki Hong <eunkiki.hong@samsung.com>
Sat, 12 Oct 2024 01:24:26 +0000 (10:24 +0900)
This reverts commit 4efe5972ade44287fae7b8fb4d538c3f5bc2323b.

Change-Id: I1fd8214150055e451f105b533a9cf7588d38313e

21 files changed:
dali/devel-api/adaptor-framework/accessibility.cpp
dali/devel-api/adaptor-framework/atspi-accessibility.cpp
dali/devel-api/adaptor-framework/atspi-accessibility.h
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/internal/accessibility/bridge/bridge-base.cpp
dali/internal/window-system/android/window-base-android.cpp
dali/internal/window-system/android/window-base-android.h
dali/internal/window-system/common/window-base.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/macos/window-base-mac.h
dali/internal/window-system/macos/window-base-mac.mm
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h
dali/internal/window-system/windows/window-base-win.cpp
dali/internal/window-system/windows/window-base-win.h
dali/internal/window-system/x11/window-base-x.cpp
dali/internal/window-system/x11/window-base-x.h

index f6e1702eaf7f29fb6686d240b5f0942bd12bee18..fe0b3a51778bb29b91292034bed0f87dd061470e 100644 (file)
@@ -359,17 +359,6 @@ public:
   {
   }
 
-  ~AdaptorAccessible() override
-  {
-    if(mRoot)
-    {
-      if(auto bridge = Accessibility::Bridge::GetCurrentBridge())
-      {
-        bridge->RemoveTopLevelWindow(this);
-      }
-    }
-  }
-
   bool GrabFocus() override
   {
     return false;
index c5d33a1547b04d47effcb25d8c040f6fc1f96384..1adebe75636d291bbad92e32b9b9ce54649152ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -61,6 +61,59 @@ void Dali::AtspiAccessibility::Say(const std::string& text, bool discardable, st
   }
 }
 
+int Dali::AtspiAccessibility::SetForcefully(bool turnOn)
+{
+  if(turnOn)
+  {
+    if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
+    {
+      bridge->Initialize();
+      auto ret = bridge->ForceUp();
+      return (int)ret;
+    }
+  }
+  else
+  {
+    if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
+    {
+      bridge->ForceDown();
+      return 0;
+    }
+  }
+  return -1;
+}
+
+int Dali::AtspiAccessibility::GetStatus()
+{
+  //0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF), 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
+  if(auto bridge = Dali::Accessibility::Bridge::GetCurrentBridge())
+  {
+    if(bridge->GetScreenReaderEnabled())
+    {
+      if(bridge->IsEnabled())
+      {
+        return 3;
+      }
+      else
+      {
+        return 2;
+      }
+    }
+    else
+    {
+      if(bridge->IsEnabled())
+      {
+        return 1;
+      }
+      else
+      {
+        return 0;
+      }
+    }
+  }
+  return -1;
+}
+
 bool Dali::AtspiAccessibility::IsEnabled()
 {
   return Dali::Accessibility::IsUp();
index 26ca5f2dc32c0889d14eec7f5adb61258bdc37e4..3ee0674ea5d6deae1aa3b5001b09f22c5c4cc1ea 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_DEVEL_ATSPI_ACCESSIBILITY_H
 #define DALI_DEVEL_ATSPI_ACCESSIBILITY_H
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -64,6 +64,22 @@ DALI_ADAPTOR_API void StopReading(bool alsoNonDiscardable = false);
  */
 DALI_ADAPTOR_API bool SuppressScreenReader(bool suppress);
 
+/**
+ * @brief Sets ATSPI to be turned On or Off forcibly.
+ *
+ * @param[in] turnOn true to turn on, false to turn off.
+ * @return The status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
+ * 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
+ */
+DALI_ADAPTOR_API int SetForcefully(bool turnOn);
+
+/**
+ * @brief Gets ATSPI status.
+ * @return Status of ATSPI : 0(ATSPI OFF, ScreenReader OFF), 1(ATSPI ON, ScreenReader OFF),
+ * 2 (ATSPI OFF, ScreenReader ON), 3(ATSPI ON, ScreenReader ON)
+ */
+DALI_ADAPTOR_API int GetStatus();
+
 /**
  * @brief Returns whether the state of Accessibility is enabled or not.
  *
index 8f3456d68b5d4cc8fce921936766f942dec43f70..37a107cc5381e67ad13243504da42b505e0efab4 100644 (file)
@@ -389,9 +389,9 @@ bool IsAlwaysOnTop(Window window)
   return GetImplementation(window).IsAlwaysOnTop();
 }
 
-void SetBottom(Window window, bool enable)
+void SetToBottom(Window window, bool toBottom)
 {
-  GetImplementation(window).SetBottom(enable);
+  GetImplementation(window).SetToBottom(toBottom);
 }
 
 bool IsBottom(Window window)
index e2ab62566653fef8503b483d44beb66acc0161d1..34e06e17eb7a29b5f7c88ca5b1a13cf777ca05ea 100644 (file)
@@ -685,9 +685,7 @@ DALI_ADAPTOR_API bool IsModal(Window window);
 
 /**
  * @brief Enables or disables the window always is on top.
- *
- * This is valid between windows that have no notification level or a notification level of 'none'.
- * If it has a notification level, this will not do anything.
+ * 
  *
  * @param[in] window The window instance.
  * @param[in] alwaysOnTop true to enable the window always is on top, false to disable.
@@ -697,21 +695,21 @@ DALI_ADAPTOR_API void SetAlwaysOnTop(Window window, bool alwaysOnTop);
 /**
  * @brief Returns whether the window always is on top.
  *
+ * This is valid between windows that have no notification level or a notification level of 'none'.
+ * If it has a notification level, this will not do anything.
+ *
  * @param[in] window The window instance.
  * @return True if the window always is on top, false otherwise.
  */
 DALI_ADAPTOR_API bool IsAlwaysOnTop(Window window);
 
 /**
- * @brief Enables or disables the window's layer is changed to bottom.
- *
- * If the enable flag is true, this window will be placed below other windows.
- * Otherwise, if it's called with a false value, it will be located above other windows.
+ * @brief Enables or disables the window's layer is changed to the bottom.
  *
  * @param[in] window The window instance.
- * @param[in] enable true to change the window layer to the bottom.
+ * @param[in] toBottom true to change the window layer to the bottom.
  */
-DALI_ADAPTOR_API void SetBottom(Window window, bool enable);
+DALI_ADAPTOR_API void SetToBottom(Window window, bool toBottom);
 
 /**
  * @brief Returns whether the window layer is the bottom or not.
index 3179368beb985009496a8c9eb9b5588d28275d84..0e3269c37e6ff067cc23afcbb188ef6291d0dc2c 100644 (file)
@@ -38,6 +38,7 @@ BridgeBase::BridgeBase()
 
 BridgeBase::~BridgeBase()
 {
+  mApplication.mChildren.clear();
 }
 
 void BridgeBase::AddCoalescableMessage(CoalescableMessages kind, Dali::Accessibility::Accessible* obj, float delay, std::function<void()> functor)
@@ -224,7 +225,6 @@ void BridgeBase::RemoveTopLevelWindow(Accessible* windowAccessible)
     if(mApplication.mChildren[i] == windowAccessible)
     {
       mApplication.mChildren.erase(mApplication.mChildren.begin() + i);
-      Emit(windowAccessible, WindowEvent::DESTROY);
       break;
     }
   }
index cb9aea66de4ac545a3ad3245995ae8fd0ee7522c..75e37e64adc906f1713b5f92f71db6bb08f6acbe 100644 (file)
@@ -516,7 +516,7 @@ bool WindowBaseAndroid::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseAndroid::SetBottom(bool enable)
+void WindowBaseAndroid::SetToBottom(bool toBottom)
 {
 }
 
index a7ffb96ba52d9e6bc3fd79f118fc720ea5bfbfa6..e6db23f5b04de09e24bcc6d9f9af7211d0abae8b 100644 (file)
@@ -540,9 +540,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
    */
-  void SetBottom(bool enable) override;
+  void SetToBottom(bool toBottom) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
index 5afb0848aaeca3ba158dae43d94d80f60d85369e..91b2dd26c8fcc8d5a7ba53aaa2af1ef4fb2339c0 100644 (file)
@@ -597,15 +597,11 @@ public:
   virtual bool IsAlwaysOnTop() = 0;
 
   /**
-   * @brief Enables or disables the window's layer is changed to bottom.
+   * @brief Enables or disables the window's layer is changed to the bottom.
    *
-   * If the enable flag is true, this window will be placed below other windows.
-   * Otherwise, if it's called with a false value, it will be located above other windows.
-   *
-   * @param[in] window The window instance.
-   * @param[in] enable true to change the window layer to the bottom.
+   * @param[in] toBottom true to change the window layer to the bottom.
    */
-  virtual void SetBottom(bool enable) = 0;
+  virtual void SetToBottom(bool toBottom) = 0;
 
   /**
    * @brief Returns whether the window layer is the bottom or not.
index 279630f94df3e176971578fef4c2c5c0901d758f..df760143b49f6eb1cf9f08b211257bc1bee4075d 100644 (file)
@@ -113,6 +113,16 @@ Window::Window()
 
 Window::~Window()
 {
+  if(mScene)
+  {
+    auto bridge     = Accessibility::Bridge::GetCurrentBridge();
+    auto rootLayer  = mScene.GetRootLayer();
+    auto accessible = Accessibility::Accessible::Get(rootLayer);
+    bridge->RemoveTopLevelWindow(accessible);
+    // Related to multi-window case. This is called for default window and non-default window, but it is effective for non-default window.
+    bridge->Emit(accessible, Accessibility::WindowEvent::DESTROY);
+  }
+
   if(mAdaptor)
   {
     mAdaptor->RemoveWindow(this);
@@ -1298,9 +1308,14 @@ void Window::OnAccessibilityEnabled()
 
 void Window::OnAccessibilityDisabled()
 {
+  auto bridge     = Accessibility::Bridge::GetCurrentBridge();
+  auto rootLayer  = mScene.GetRootLayer();
+  auto accessible = Accessibility::Accessible::Get(rootLayer);
+
   DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Accessibility is disabled\n", this, mNativeWindowId);
 
   InterceptKeyEventSignal().Disconnect(this, &Window::OnAccessibilityInterceptKeyEvent);
+  bridge->RemoveTopLevelWindow(accessible);
 }
 
 bool Window::OnAccessibilityInterceptKeyEvent(const Dali::KeyEvent& keyEvent)
@@ -1634,9 +1649,9 @@ bool Window::IsAlwaysOnTop()
   return mWindowBase->IsAlwaysOnTop();
 }
 
-void Window::SetBottom(bool enable)
+void Window::SetToBottom(bool toBottom)
 {
-  mWindowBase->SetBottom(enable);
+  mWindowBase->SetToBottom(toBottom);
 }
 
 bool Window::IsBottom()
index 3c31b00ab00f07a9472db3adb6a352c15c4ff185..c995aed9eccba5989f6521e7dc0c65dcb03d1ed6 100644 (file)
@@ -603,9 +603,9 @@ public: // Dali::Internal::Adaptor::SceneHolder
   bool IsAlwaysOnTop();
 
   /**
-   * @copydoc Dali::DevelWindow::SetBottom()
+   * @copydoc Dali::DevelWindow::SetToBottom()
    */
-  void SetBottom(bool enable);
+  void SetToBottom(bool toBottom);
 
   /**
    * @copydoc Dali::DevelWindow::IsBottom()
index fd50d91de44cd4b2e404a71b468e26a5d08e8f91..114e95af208ae68590bf36c344c142de302590eb 100644 (file)
@@ -468,9 +468,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
    */
-  void SetBottom(bool enable) override;
+  void SetToBottom(bool toBottom) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
index a414e0529ae4f2bbfeb67922e2490f11ca5c6730..ca471b1a259d3ae3470e1e6bdc3e94512d6da04a 100644 (file)
@@ -824,7 +824,7 @@ bool WindowBaseCocoa::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseCocoa::SetBottom(bool enable)
+void WindowBaseCocoa::SetToBottom(bool toBottom)
 {
 }
 
index 6027bb16d1d2498668c4fa1dd40d62af11d6a65b..1ea0a044db196633d06f2626b7fca3d31ea036e0 100644 (file)
@@ -937,7 +937,7 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surf
   mBrightnessChangeDone(true),
   mIsFrontBufferRendering(false),
   mIsIMEWindowInitialized(false),
-  mBottom(false)
+  mToBottom(false)
 {
   Initialize(positionSize, surface, isTransparent);
 }
@@ -3702,27 +3702,27 @@ bool WindowBaseEcoreWl2::IsAlwaysOnTop()
   return ret;
 }
 
-void WindowBaseEcoreWl2::SetBottom(bool enable)
+void WindowBaseEcoreWl2::SetToBottom(bool toBottom)
 {
   START_DURATION_CHECK();
-  mBottom = enable;
-  if(mBottom)
+  mToBottom = toBottom;
+  if(toBottom)
   {
-    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_BELOW\n", mEcoreWindow, mBottom);
+    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_BELOW\n", mEcoreWindow, toBottom);
     ecore_wl2_window_stack_mode_set(mEcoreWindow, ECORE_WL2_WINDOW_STACK_BELOW);
   }
   else
   {
-    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_NONE\n", mEcoreWindow, mBottom);
+    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_NONE\n", mEcoreWindow, toBottom);
     ecore_wl2_window_stack_mode_set(mEcoreWindow, ECORE_WL2_WINDOW_STACK_NONE);
   }
   ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE);
-  FINISH_DURATION_CHECK("ecore_wl2_window_stack_mode_set");
+  FINISH_DURATION_CHECK("ecore_wl2_window_pin_mode_set");
 }
 
 bool WindowBaseEcoreWl2::IsBottom()
 {
-  return mBottom;
+  return mToBottom;
 }
 
 Any WindowBaseEcoreWl2::GetNativeBuffer() const
index 1d12c2de538158e90f661ba2ac0452a830d8234a..0df5b4afcb4eea464a1f58ca0add627362eb5199 100644 (file)
@@ -683,9 +683,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
    */
-  void SetBottom(bool enable) override;
+  void SetToBottom(bool toBottom) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
@@ -816,7 +816,7 @@ private:
   bool mBrightnessChangeDone;
   bool mIsFrontBufferRendering;
   bool mIsIMEWindowInitialized;
-  bool mBottom;
+  bool mToBottom;
 };
 
 } // namespace Adaptor
index cdb15dad14e2dc56331822f9bb3444b91aefec8d..69bb658d18ff55bfc332b776806e7135437a2ac9 100644 (file)
@@ -1115,7 +1115,7 @@ bool WindowBaseEcoreX::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseEcoreX::SetBottom(bool enable)
+void WindowBaseEcoreX::SetToBottom(bool toBottom)
 {
 }
 
index eaacefc0891d3e70eda8549ac37841dd2672318a..4c65241a4563f74ea9757e2466b4600438ffe313 100644 (file)
@@ -545,9 +545,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
    */
-  void SetBottom(bool enable) override;
+  void SetToBottom(bool toBottom) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
index 12a152177b27d827c3f7c2830bc9f79e7732512b..784d51760caf932e5917b325eece2c8d87f64066 100644 (file)
@@ -744,7 +744,7 @@ bool WindowBaseWin::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseWin::SetBottom(bool enable)
+void WindowBaseWin::SetToBottom(bool toBottom)
 {
 }
 
index c69991ac2454b8abd238baa20ca9d220366cf937..3e0a0c720b99294b934777f2ed9a76ca8ba2b7ce 100644 (file)
@@ -527,9 +527,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
    */
-  void SetBottom(bool enable) override;
+  void SetToBottom(bool toBottom) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
index f1164d1e42b3c9ed1c162715b9b1a1d3e15edeee..32b7cdc297b5bc64b22da0fc37b4302a4ad4ce2d 100644 (file)
@@ -1049,7 +1049,7 @@ bool WindowBaseX::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseX::SetBottom(bool enable)
+void WindowBaseX::SetToBottom(bool toBottom)
 {
 }
 
index fd3c9f474cfd42f676e30b673826d3ff2d221ebe..6e43002289ee83506f2efd5d60ef3893b05892ca 100644 (file)
@@ -550,9 +550,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
    */
-  void SetBottom(bool enable) override;
+  void SetToBottom(bool toBottom) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()