Revert "[Tizen] Reset to "Supports to change the window layer to the bottom""
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 16 Oct 2024 06:50:06 +0000 (15:50 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 16 Oct 2024 06:50:06 +0000 (15:50 +0900)
This reverts commit 9a451eebfb7b7dd583ccabb8f9c63ea265863b49.

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 fe0b3a51778bb29b91292034bed0f87dd061470e..f6e1702eaf7f29fb6686d240b5f0942bd12bee18 100644 (file)
@@ -359,6 +359,17 @@ public:
   {
   }
 
+  ~AdaptorAccessible() override
+  {
+    if(mRoot)
+    {
+      if(auto bridge = Accessibility::Bridge::GetCurrentBridge())
+      {
+        bridge->RemoveTopLevelWindow(this);
+      }
+    }
+  }
+
   bool GrabFocus() override
   {
     return false;
index 1adebe75636d291bbad92e32b9b9ce54649152ef..c5d33a1547b04d47effcb25d8c040f6fc1f96384 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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,59 +61,6 @@ 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 3ee0674ea5d6deae1aa3b5001b09f22c5c4cc1ea..26ca5f2dc32c0889d14eec7f5adb61258bdc37e4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef DALI_DEVEL_ATSPI_ACCESSIBILITY_H
 #define DALI_DEVEL_ATSPI_ACCESSIBILITY_H
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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,22 +64,6 @@ 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 37a107cc5381e67ad13243504da42b505e0efab4..8f3456d68b5d4cc8fce921936766f942dec43f70 100644 (file)
@@ -389,9 +389,9 @@ bool IsAlwaysOnTop(Window window)
   return GetImplementation(window).IsAlwaysOnTop();
 }
 
-void SetToBottom(Window window, bool toBottom)
+void SetBottom(Window window, bool enable)
 {
-  GetImplementation(window).SetToBottom(toBottom);
+  GetImplementation(window).SetBottom(enable);
 }
 
 bool IsBottom(Window window)
index 34e06e17eb7a29b5f7c88ca5b1a13cf777ca05ea..e2ab62566653fef8503b483d44beb66acc0161d1 100644 (file)
@@ -685,7 +685,9 @@ 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.
@@ -695,21 +697,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 the bottom.
+ * @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.
  *
  * @param[in] window The window instance.
- * @param[in] toBottom true to change the window layer to the bottom.
+ * @param[in] enable true to change the window layer to the bottom.
  */
-DALI_ADAPTOR_API void SetToBottom(Window window, bool toBottom);
+DALI_ADAPTOR_API void SetBottom(Window window, bool enable);
 
 /**
  * @brief Returns whether the window layer is the bottom or not.
index 0e3269c37e6ff067cc23afcbb188ef6291d0dc2c..3179368beb985009496a8c9eb9b5588d28275d84 100644 (file)
@@ -38,7 +38,6 @@ BridgeBase::BridgeBase()
 
 BridgeBase::~BridgeBase()
 {
-  mApplication.mChildren.clear();
 }
 
 void BridgeBase::AddCoalescableMessage(CoalescableMessages kind, Dali::Accessibility::Accessible* obj, float delay, std::function<void()> functor)
@@ -225,6 +224,7 @@ void BridgeBase::RemoveTopLevelWindow(Accessible* windowAccessible)
     if(mApplication.mChildren[i] == windowAccessible)
     {
       mApplication.mChildren.erase(mApplication.mChildren.begin() + i);
+      Emit(windowAccessible, WindowEvent::DESTROY);
       break;
     }
   }
index 75e37e64adc906f1713b5f92f71db6bb08f6acbe..cb9aea66de4ac545a3ad3245995ae8fd0ee7522c 100644 (file)
@@ -516,7 +516,7 @@ bool WindowBaseAndroid::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseAndroid::SetToBottom(bool toBottom)
+void WindowBaseAndroid::SetBottom(bool enable)
 {
 }
 
index e6db23f5b04de09e24bcc6d9f9af7211d0abae8b..a7ffb96ba52d9e6bc3fd79f118fc720ea5bfbfa6 100644 (file)
@@ -540,9 +540,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
    */
-  void SetToBottom(bool toBottom) override;
+  void SetBottom(bool enable) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
index 91b2dd26c8fcc8d5a7ba53aaa2af1ef4fb2339c0..5afb0848aaeca3ba158dae43d94d80f60d85369e 100644 (file)
@@ -597,11 +597,15 @@ public:
   virtual bool IsAlwaysOnTop() = 0;
 
   /**
-   * @brief Enables or disables the window's layer is changed to the bottom.
+   * @brief Enables or disables the window's layer is changed to bottom.
    *
-   * @param[in] toBottom true to change the window layer 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.
    */
-  virtual void SetToBottom(bool toBottom) = 0;
+  virtual void SetBottom(bool enable) = 0;
 
   /**
    * @brief Returns whether the window layer is the bottom or not.
index df760143b49f6eb1cf9f08b211257bc1bee4075d..279630f94df3e176971578fef4c2c5c0901d758f 100644 (file)
@@ -113,16 +113,6 @@ 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);
@@ -1308,14 +1298,9 @@ 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)
@@ -1649,9 +1634,9 @@ bool Window::IsAlwaysOnTop()
   return mWindowBase->IsAlwaysOnTop();
 }
 
-void Window::SetToBottom(bool toBottom)
+void Window::SetBottom(bool enable)
 {
-  mWindowBase->SetToBottom(toBottom);
+  mWindowBase->SetBottom(enable);
 }
 
 bool Window::IsBottom()
index c995aed9eccba5989f6521e7dc0c65dcb03d1ed6..3c31b00ab00f07a9472db3adb6a352c15c4ff185 100644 (file)
@@ -603,9 +603,9 @@ public: // Dali::Internal::Adaptor::SceneHolder
   bool IsAlwaysOnTop();
 
   /**
-   * @copydoc Dali::DevelWindow::SetToBottom()
+   * @copydoc Dali::DevelWindow::SetBottom()
    */
-  void SetToBottom(bool toBottom);
+  void SetBottom(bool enable);
 
   /**
    * @copydoc Dali::DevelWindow::IsBottom()
index 114e95af208ae68590bf36c344c142de302590eb..fd50d91de44cd4b2e404a71b468e26a5d08e8f91 100644 (file)
@@ -468,9 +468,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
    */
-  void SetToBottom(bool toBottom) override;
+  void SetBottom(bool enable) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
index ca471b1a259d3ae3470e1e6bdc3e94512d6da04a..a414e0529ae4f2bbfeb67922e2490f11ca5c6730 100644 (file)
@@ -824,7 +824,7 @@ bool WindowBaseCocoa::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseCocoa::SetToBottom(bool toBottom)
+void WindowBaseCocoa::SetBottom(bool enable)
 {
 }
 
index 1ea0a044db196633d06f2626b7fca3d31ea036e0..6027bb16d1d2498668c4fa1dd40d62af11d6a65b 100644 (file)
@@ -937,7 +937,7 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surf
   mBrightnessChangeDone(true),
   mIsFrontBufferRendering(false),
   mIsIMEWindowInitialized(false),
-  mToBottom(false)
+  mBottom(false)
 {
   Initialize(positionSize, surface, isTransparent);
 }
@@ -3702,27 +3702,27 @@ bool WindowBaseEcoreWl2::IsAlwaysOnTop()
   return ret;
 }
 
-void WindowBaseEcoreWl2::SetToBottom(bool toBottom)
+void WindowBaseEcoreWl2::SetBottom(bool enable)
 {
   START_DURATION_CHECK();
-  mToBottom = toBottom;
-  if(toBottom)
+  mBottom = enable;
+  if(mBottom)
   {
-    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_BELOW\n", mEcoreWindow, toBottom);
+    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_BELOW\n", mEcoreWindow, mBottom);
     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, toBottom);
+    DALI_LOG_RELEASE_INFO("ecore_wl2_window_stack_mode_set, window: [%p], flag[%d] ECORE_WL2_WINDOW_STACK_NONE\n", mEcoreWindow, mBottom);
     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_pin_mode_set");
+  FINISH_DURATION_CHECK("ecore_wl2_window_stack_mode_set");
 }
 
 bool WindowBaseEcoreWl2::IsBottom()
 {
-  return mToBottom;
+  return mBottom;
 }
 
 Any WindowBaseEcoreWl2::GetNativeBuffer() const
index 0df5b4afcb4eea464a1f58ca0add627362eb5199..1d12c2de538158e90f661ba2ac0452a830d8234a 100644 (file)
@@ -683,9 +683,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
    */
-  void SetToBottom(bool toBottom) override;
+  void SetBottom(bool enable) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
@@ -816,7 +816,7 @@ private:
   bool mBrightnessChangeDone;
   bool mIsFrontBufferRendering;
   bool mIsIMEWindowInitialized;
-  bool mToBottom;
+  bool mBottom;
 };
 
 } // namespace Adaptor
index 69bb658d18ff55bfc332b776806e7135437a2ac9..cdb15dad14e2dc56331822f9bb3444b91aefec8d 100644 (file)
@@ -1115,7 +1115,7 @@ bool WindowBaseEcoreX::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseEcoreX::SetToBottom(bool toBottom)
+void WindowBaseEcoreX::SetBottom(bool enable)
 {
 }
 
index 4c65241a4563f74ea9757e2466b4600438ffe313..eaacefc0891d3e70eda8549ac37841dd2672318a 100644 (file)
@@ -545,9 +545,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
    */
-  void SetToBottom(bool toBottom) override;
+  void SetBottom(bool enable) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
index 784d51760caf932e5917b325eece2c8d87f64066..12a152177b27d827c3f7c2830bc9f79e7732512b 100644 (file)
@@ -744,7 +744,7 @@ bool WindowBaseWin::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseWin::SetToBottom(bool toBottom)
+void WindowBaseWin::SetBottom(bool enable)
 {
 }
 
index 3e0a0c720b99294b934777f2ed9a76ca8ba2b7ce..c69991ac2454b8abd238baa20ca9d220366cf937 100644 (file)
@@ -527,9 +527,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
    */
-  void SetToBottom(bool toBottom) override;
+  void SetBottom(bool enable) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()
index 32b7cdc297b5bc64b22da0fc37b4302a4ad4ce2d..f1164d1e42b3c9ed1c162715b9b1a1d3e15edeee 100644 (file)
@@ -1049,7 +1049,7 @@ bool WindowBaseX::IsAlwaysOnTop()
   return false;
 }
 
-void WindowBaseX::SetToBottom(bool toBottom)
+void WindowBaseX::SetBottom(bool enable)
 {
 }
 
index 6e43002289ee83506f2efd5d60ef3893b05892ca..fd3c9f474cfd42f676e30b673826d3ff2d221ebe 100644 (file)
@@ -550,9 +550,9 @@ public:
   bool IsAlwaysOnTop() override;
 
   /**
-   * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom()
+   * @copydoc Dali::Internal::Adaptor::WindowBase::SetBottom()
    */
-  void SetToBottom(bool toBottom) override;
+  void SetBottom(bool enable) override;
 
   /**
    * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom()