From: Eunki, Hong Date: Wed, 16 Oct 2024 06:50:06 +0000 (+0900) Subject: Revert "[Tizen] Reset to "Supports to change the window layer to the bottom"" X-Git-Tag: accepted/tizen/unified/x/20241017.075834~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d97355ad17ecedd0644aa053f57cb15ad8bda0fc;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Revert "[Tizen] Reset to "Supports to change the window layer to the bottom"" This reverts commit 9a451eebfb7b7dd583ccabb8f9c63ea265863b49. --- diff --git a/dali/devel-api/adaptor-framework/accessibility.cpp b/dali/devel-api/adaptor-framework/accessibility.cpp index fe0b3a517..f6e1702ea 100644 --- a/dali/devel-api/adaptor-framework/accessibility.cpp +++ b/dali/devel-api/adaptor-framework/accessibility.cpp @@ -359,6 +359,17 @@ public: { } + ~AdaptorAccessible() override + { + if(mRoot) + { + if(auto bridge = Accessibility::Bridge::GetCurrentBridge()) + { + bridge->RemoveTopLevelWindow(this); + } + } + } + bool GrabFocus() override { return false; diff --git a/dali/devel-api/adaptor-framework/atspi-accessibility.cpp b/dali/devel-api/adaptor-framework/atspi-accessibility.cpp index 1adebe756..c5d33a154 100644 --- a/dali/devel-api/adaptor-framework/atspi-accessibility.cpp +++ b/dali/devel-api/adaptor-framework/atspi-accessibility.cpp @@ -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(); diff --git a/dali/devel-api/adaptor-framework/atspi-accessibility.h b/dali/devel-api/adaptor-framework/atspi-accessibility.h index 3ee0674ea..26ca5f2dc 100644 --- a/dali/devel-api/adaptor-framework/atspi-accessibility.h +++ b/dali/devel-api/adaptor-framework/atspi-accessibility.h @@ -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. * diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 37a107cc5..8f3456d68 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -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) diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 34e06e17e..e2ab62566 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -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. diff --git a/dali/internal/accessibility/bridge/bridge-base.cpp b/dali/internal/accessibility/bridge/bridge-base.cpp index 0e3269c37..3179368be 100644 --- a/dali/internal/accessibility/bridge/bridge-base.cpp +++ b/dali/internal/accessibility/bridge/bridge-base.cpp @@ -38,7 +38,6 @@ BridgeBase::BridgeBase() BridgeBase::~BridgeBase() { - mApplication.mChildren.clear(); } void BridgeBase::AddCoalescableMessage(CoalescableMessages kind, Dali::Accessibility::Accessible* obj, float delay, std::function 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; } } diff --git a/dali/internal/window-system/android/window-base-android.cpp b/dali/internal/window-system/android/window-base-android.cpp index 75e37e64a..cb9aea66d 100644 --- a/dali/internal/window-system/android/window-base-android.cpp +++ b/dali/internal/window-system/android/window-base-android.cpp @@ -516,7 +516,7 @@ bool WindowBaseAndroid::IsAlwaysOnTop() return false; } -void WindowBaseAndroid::SetToBottom(bool toBottom) +void WindowBaseAndroid::SetBottom(bool enable) { } diff --git a/dali/internal/window-system/android/window-base-android.h b/dali/internal/window-system/android/window-base-android.h index e6db23f5b..a7ffb96ba 100644 --- a/dali/internal/window-system/android/window-base-android.h +++ b/dali/internal/window-system/android/window-base-android.h @@ -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() diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 91b2dd26c..5afb0848a 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -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. diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index df760143b..279630f94 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -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() diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index c995aed9e..3c31b00ab 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -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() diff --git a/dali/internal/window-system/macos/window-base-mac.h b/dali/internal/window-system/macos/window-base-mac.h index 114e95af2..fd50d91de 100644 --- a/dali/internal/window-system/macos/window-base-mac.h +++ b/dali/internal/window-system/macos/window-base-mac.h @@ -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() diff --git a/dali/internal/window-system/macos/window-base-mac.mm b/dali/internal/window-system/macos/window-base-mac.mm index ca471b1a2..a414e0529 100644 --- a/dali/internal/window-system/macos/window-base-mac.mm +++ b/dali/internal/window-system/macos/window-base-mac.mm @@ -824,7 +824,7 @@ bool WindowBaseCocoa::IsAlwaysOnTop() return false; } -void WindowBaseCocoa::SetToBottom(bool toBottom) +void WindowBaseCocoa::SetBottom(bool enable) { } diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 1ea0a044d..6027bb16d 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -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 diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index 0df5b4afc..1d12c2de5 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -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 diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp index 69bb658d1..cdb15dad1 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.cpp @@ -1115,7 +1115,7 @@ bool WindowBaseEcoreX::IsAlwaysOnTop() return false; } -void WindowBaseEcoreX::SetToBottom(bool toBottom) +void WindowBaseEcoreX::SetBottom(bool enable) { } diff --git a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h index 4c65241a4..eaacefc08 100644 --- a/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h +++ b/dali/internal/window-system/ubuntu-x11/window-base-ecore-x.h @@ -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() diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index 784d51760..12a152177 100644 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -744,7 +744,7 @@ bool WindowBaseWin::IsAlwaysOnTop() return false; } -void WindowBaseWin::SetToBottom(bool toBottom) +void WindowBaseWin::SetBottom(bool enable) { } diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index 3e0a0c720..c69991ac2 100644 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -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() diff --git a/dali/internal/window-system/x11/window-base-x.cpp b/dali/internal/window-system/x11/window-base-x.cpp index 32b7cdc29..f1164d1e4 100644 --- a/dali/internal/window-system/x11/window-base-x.cpp +++ b/dali/internal/window-system/x11/window-base-x.cpp @@ -1049,7 +1049,7 @@ bool WindowBaseX::IsAlwaysOnTop() return false; } -void WindowBaseX::SetToBottom(bool toBottom) +void WindowBaseX::SetBottom(bool enable) { } diff --git a/dali/internal/window-system/x11/window-base-x.h b/dali/internal/window-system/x11/window-base-x.h index 6e4300228..fd3c9f474 100644 --- a/dali/internal/window-system/x11/window-base-x.h +++ b/dali/internal/window-system/x11/window-base-x.h @@ -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()