From 73c19f226de95262f126266a3d101d2cee0fccaa Mon Sep 17 00:00:00 2001 From: Wonsik Jung Date: Thu, 19 Sep 2024 22:02:19 +0900 Subject: [PATCH] Supports to change the window layer to the bottom Supports to change the window layer to the bottom. It is only efffected with same notification layer. Change-Id: Ib336a9d9b725b076045a225316900ab193711686 --- .../adaptor-framework/window-devel.cpp | 10 +++++++ .../adaptor-framework/window-devel.h | 20 ++++++++++++++ .../android/window-base-android.cpp | 9 +++++++ .../android/window-base-android.h | 10 +++++++ .../window-system/common/window-base.h | 17 ++++++++++++ .../window-system/common/window-impl.cpp | 10 +++++++ .../window-system/common/window-impl.h | 10 +++++++ .../window-system/macos/window-base-mac.h | 10 +++++++ .../window-system/macos/window-base-mac.mm | 9 +++++++ .../ecore-wl2/window-base-ecore-wl2.cpp | 27 ++++++++++++++++++- .../ecore-wl2/window-base-ecore-wl2.h | 11 ++++++++ .../ubuntu-x11/window-base-ecore-x.cpp | 9 +++++++ .../ubuntu-x11/window-base-ecore-x.h | 10 +++++++ .../window-system/windows/window-base-win.cpp | 9 +++++++ .../window-system/windows/window-base-win.h | 10 +++++++ .../window-system/x11/window-base-x.cpp | 9 +++++++ .../window-system/x11/window-base-x.h | 10 +++++++ 17 files changed, 199 insertions(+), 1 deletion(-) diff --git a/dali/devel-api/adaptor-framework/window-devel.cpp b/dali/devel-api/adaptor-framework/window-devel.cpp index 243c8c5bb..37a107cc5 100644 --- a/dali/devel-api/adaptor-framework/window-devel.cpp +++ b/dali/devel-api/adaptor-framework/window-devel.cpp @@ -389,6 +389,16 @@ bool IsAlwaysOnTop(Window window) return GetImplementation(window).IsAlwaysOnTop(); } +void SetToBottom(Window window, bool toBottom) +{ + GetImplementation(window).SetToBottom(toBottom); +} + +bool IsBottom(Window window) +{ + return GetImplementation(window).IsBottom(); +} + Any GetNativeBuffer(Window window) { return GetImplementation(window).GetNativeBuffer(); diff --git a/dali/devel-api/adaptor-framework/window-devel.h b/dali/devel-api/adaptor-framework/window-devel.h index 481aa8d7e..34e06e17e 100644 --- a/dali/devel-api/adaptor-framework/window-devel.h +++ b/dali/devel-api/adaptor-framework/window-devel.h @@ -685,6 +685,7 @@ DALI_ADAPTOR_API bool IsModal(Window window); /** * @brief Enables or disables the window always is on top. + * * * @param[in] window The window instance. * @param[in] alwaysOnTop true to enable the window always is on top, false to disable. @@ -694,11 +695,30 @@ 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. + * + * @param[in] window The window instance. + * @param[in] toBottom true to change the window layer to the bottom. + */ +DALI_ADAPTOR_API void SetToBottom(Window window, bool toBottom); + +/** + * @brief Returns whether the window layer is the bottom or not. + * + * @param[in] window The window instance. + * @return True if the window layer is the bottom, false otherwise. + */ +DALI_ADAPTOR_API bool IsBottom(Window window); + /** * @brief Gets the native buffer of the window. * diff --git a/dali/internal/window-system/android/window-base-android.cpp b/dali/internal/window-system/android/window-base-android.cpp index 4c13e7053..75e37e64a 100644 --- a/dali/internal/window-system/android/window-base-android.cpp +++ b/dali/internal/window-system/android/window-base-android.cpp @@ -516,6 +516,15 @@ bool WindowBaseAndroid::IsAlwaysOnTop() return false; } +void WindowBaseAndroid::SetToBottom(bool toBottom) +{ +} + +bool WindowBaseAndroid::IsBottom() +{ + return false; +} + Any WindowBaseAndroid::GetNativeBuffer() const { return 0; diff --git a/dali/internal/window-system/android/window-base-android.h b/dali/internal/window-system/android/window-base-android.h index f9c4e4d55..e6db23f5b 100644 --- a/dali/internal/window-system/android/window-base-android.h +++ b/dali/internal/window-system/android/window-base-android.h @@ -539,6 +539,16 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom() + */ + void SetToBottom(bool toBottom) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom() + */ + bool IsBottom() override; + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() */ diff --git a/dali/internal/window-system/common/window-base.h b/dali/internal/window-system/common/window-base.h index 7a7ff25df..91b2dd26c 100644 --- a/dali/internal/window-system/common/window-base.h +++ b/dali/internal/window-system/common/window-base.h @@ -582,6 +582,9 @@ public: /** * @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] alwaysOnTop true to enable the window always is on top, false to disable. */ virtual void SetAlwaysOnTop(bool alwaysOnTop) = 0; @@ -593,6 +596,20 @@ public: */ virtual bool IsAlwaysOnTop() = 0; + /** + * @brief Enables or disables the window's layer is changed to the bottom. + * + * @param[in] toBottom true to change the window layer to the bottom. + */ + virtual void SetToBottom(bool toBottom) = 0; + + /** + * @brief Returns whether the window layer is the bottom or not. + * + * @return True if the window layer is the bottom, false otherwise. + */ + virtual bool IsBottom() = 0; + /** * @brief Get native buffer of window. * @return The native window buffer handle diff --git a/dali/internal/window-system/common/window-impl.cpp b/dali/internal/window-system/common/window-impl.cpp index 2ff068ec7..df760143b 100644 --- a/dali/internal/window-system/common/window-impl.cpp +++ b/dali/internal/window-system/common/window-impl.cpp @@ -1649,6 +1649,16 @@ bool Window::IsAlwaysOnTop() return mWindowBase->IsAlwaysOnTop(); } +void Window::SetToBottom(bool toBottom) +{ + mWindowBase->SetToBottom(toBottom); +} + +bool Window::IsBottom() +{ + return mWindowBase->IsBottom(); +} + Dali::Any Window::GetNativeBuffer() const { return mWindowBase->GetNativeBuffer(); diff --git a/dali/internal/window-system/common/window-impl.h b/dali/internal/window-system/common/window-impl.h index 031046915..c995aed9e 100644 --- a/dali/internal/window-system/common/window-impl.h +++ b/dali/internal/window-system/common/window-impl.h @@ -602,6 +602,16 @@ public: // Dali::Internal::Adaptor::SceneHolder */ bool IsAlwaysOnTop(); + /** + * @copydoc Dali::DevelWindow::SetToBottom() + */ + void SetToBottom(bool toBottom); + + /** + * @copydoc Dali::DevelWindow::IsBottom() + */ + bool IsBottom(); + /** * @copydoc Dali::DevelWindow::GetNativeBuffer() */ diff --git a/dali/internal/window-system/macos/window-base-mac.h b/dali/internal/window-system/macos/window-base-mac.h index 190286fd4..114e95af2 100644 --- a/dali/internal/window-system/macos/window-base-mac.h +++ b/dali/internal/window-system/macos/window-base-mac.h @@ -467,6 +467,16 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom() + */ + void SetToBottom(bool toBottom) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom() + */ + bool IsBottom() override; + /** * @brief Sets front buffer rendering to the window. * @param[in] enable True to enable front buffer rendering mode, False to otherwise. diff --git a/dali/internal/window-system/macos/window-base-mac.mm b/dali/internal/window-system/macos/window-base-mac.mm index 303ddf2ad..ca471b1a2 100644 --- a/dali/internal/window-system/macos/window-base-mac.mm +++ b/dali/internal/window-system/macos/window-base-mac.mm @@ -824,6 +824,15 @@ bool WindowBaseCocoa::IsAlwaysOnTop() return false; } +void WindowBaseCocoa::SetToBottom(bool toBottom) +{ +} + +bool WindowBaseCocoa::IsBottom() +{ + return false; +} + Any WindowBaseCocoa::GetNativeBuffer() const { return 0; 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 343347c92..1ea0a044d 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 @@ -936,7 +936,8 @@ WindowBaseEcoreWl2::WindowBaseEcoreWl2(Dali::PositionSize positionSize, Any surf mOwnSurface(false), mBrightnessChangeDone(true), mIsFrontBufferRendering(false), - mIsIMEWindowInitialized(false) + mIsIMEWindowInitialized(false), + mToBottom(false) { Initialize(positionSize, surface, isTransparent); } @@ -3690,6 +3691,7 @@ void WindowBaseEcoreWl2::SetAlwaysOnTop(bool alwaysOnTop) DALI_LOG_RELEASE_INFO("ecore_wl2_window_pin_mode_set, window: [%p], flag [%d]\n", mEcoreWindow, alwaysOnTop); START_DURATION_CHECK(); ecore_wl2_window_pin_mode_set(mEcoreWindow, alwaysOnTop); + ecore_wl2_window_commit(mEcoreWindow, EINA_TRUE); FINISH_DURATION_CHECK("ecore_wl2_window_pin_mode_set"); } @@ -3700,6 +3702,29 @@ bool WindowBaseEcoreWl2::IsAlwaysOnTop() return ret; } +void WindowBaseEcoreWl2::SetToBottom(bool toBottom) +{ + START_DURATION_CHECK(); + 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, 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, 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_pin_mode_set"); +} + +bool WindowBaseEcoreWl2::IsBottom() +{ + return mToBottom; +} + Any WindowBaseEcoreWl2::GetNativeBuffer() const { DALI_LOG_RELEASE_INFO("Get wl_egl_window, ecore_window: [%p], wl_egl_window [%p]\n", mEcoreWindow, mEglWindow); 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 dd0d137ae..0df5b4afc 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 @@ -682,6 +682,16 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom() + */ + void SetToBottom(bool toBottom) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom() + */ + bool IsBottom() override; + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() */ @@ -806,6 +816,7 @@ private: bool mBrightnessChangeDone; bool mIsFrontBufferRendering; bool mIsIMEWindowInitialized; + bool mToBottom; }; } // 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 a1a434587..69bb658d1 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,6 +1115,15 @@ bool WindowBaseEcoreX::IsAlwaysOnTop() return false; } +void WindowBaseEcoreX::SetToBottom(bool toBottom) +{ +} + +bool WindowBaseEcoreX::IsBottom() +{ + return false; +} + Any WindowBaseEcoreX::GetNativeBuffer() const { return 0; 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 fb68356a3..4c65241a4 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 @@ -544,6 +544,16 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom() + */ + void SetToBottom(bool toBottom) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom() + */ + bool IsBottom() override; + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() */ diff --git a/dali/internal/window-system/windows/window-base-win.cpp b/dali/internal/window-system/windows/window-base-win.cpp index f42bd1e6d..784d51760 100644 --- a/dali/internal/window-system/windows/window-base-win.cpp +++ b/dali/internal/window-system/windows/window-base-win.cpp @@ -744,6 +744,15 @@ bool WindowBaseWin::IsAlwaysOnTop() return false; } +void WindowBaseWin::SetToBottom(bool toBottom) +{ +} + +bool WindowBaseWin::IsBottom() +{ + return false; +} + Any WindowBaseWin::GetNativeBuffer() const { return 0; diff --git a/dali/internal/window-system/windows/window-base-win.h b/dali/internal/window-system/windows/window-base-win.h index dff49ac5b..3e0a0c720 100644 --- a/dali/internal/window-system/windows/window-base-win.h +++ b/dali/internal/window-system/windows/window-base-win.h @@ -526,6 +526,16 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom() + */ + void SetToBottom(bool toBottom) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom() + */ + bool IsBottom() override; + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() */ diff --git a/dali/internal/window-system/x11/window-base-x.cpp b/dali/internal/window-system/x11/window-base-x.cpp index 7ff6b7fec..32b7cdc29 100644 --- a/dali/internal/window-system/x11/window-base-x.cpp +++ b/dali/internal/window-system/x11/window-base-x.cpp @@ -1049,6 +1049,15 @@ bool WindowBaseX::IsAlwaysOnTop() return false; } +void WindowBaseX::SetToBottom(bool toBottom) +{ +} + +bool WindowBaseX::IsBottom() +{ + return false; +} + Any WindowBaseX::GetNativeBuffer() { return 0; diff --git a/dali/internal/window-system/x11/window-base-x.h b/dali/internal/window-system/x11/window-base-x.h index 004bc3d23..6e4300228 100644 --- a/dali/internal/window-system/x11/window-base-x.h +++ b/dali/internal/window-system/x11/window-base-x.h @@ -549,6 +549,16 @@ public: */ bool IsAlwaysOnTop() override; + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::SetToBottom() + */ + void SetToBottom(bool toBottom) override; + + /** + * @copydoc Dali::Internal::Adaptor::WindowBase::IsBottom() + */ + bool IsBottom() override; + /** * @copydoc Dali::Internal::Adaptor::WindowBase::GetNativeBuffer() */ -- 2.34.1