1. Add Maximize/Minimized in Window.
This functions set maximized window or minimized window.
It is to support window border in client side.
2. Add log for egl window surface
For debugging, add log to print egl window surface's instance.
3. Fix window move or resize by display server.
When window is moved or resized by display server, DALi got configure notification event.
If DALi receives this event, DALi should not called ecore-wl2 window's move/resize function.
Change-Id: I0d1296996d9b6be152f7588913f1a16fef48f6df
END_TEST;
}
+int UtcDaliWindowMaximizeN(void)
+{
+ try
+ {
+ Dali::Window instance;
+ DevelWindow::Maximize(instance, true);
+ DALI_TEST_CHECK(false); // Should not reach here!
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliWindowIsMaximizedN(void)
+{
+ try
+ {
+ Dali::Window instance;
+ DevelWindow::IsMaximized(instance);
+ DALI_TEST_CHECK(false); // Should not reach here!
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliWindowMinimizeN(void)
+{
+ try
+ {
+ Dali::Window instance;
+ DevelWindow::Minimize(instance, true);
+ DALI_TEST_CHECK(false); // Should not reach here!
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true);
+ }
+
+ END_TEST;
+}
+
+int UtcDaliWindowIsMinimizedN(void)
+{
+ try
+ {
+ Dali::Window instance;
+ DevelWindow::IsMinimized(instance);
+ DALI_TEST_CHECK(false); // Should not reach here!
+ }
+ catch(...)
+ {
+ DALI_TEST_CHECK(true);
+ }
+
+ END_TEST;
+}
+
int UtcDaliWindowAddAvailableOrientationN(void)
{
Dali::Window window;
GetImplementation(window).FeedKeyEvent(convertedEvent);
}
+void Maximize(Window window, bool maximize)
+{
+ GetImplementation(window).Maximize(maximize);
+}
+
+bool IsMaximized(Window window)
+{
+ return GetImplementation(window).IsMaximized();
+}
+
+void Minimize(Window window, bool miniimize)
+{
+ GetImplementation(window).Minimize(miniimize);
+}
+
+bool IsMinimized(Window window)
+{
+ return GetImplementation(window).IsMinimized();
+}
+
} // namespace DevelWindow
} // namespace Dali
*/
DALI_ADAPTOR_API void FeedKeyEvent(Window window, const Dali::KeyEvent& keyEvent);
+/**
+ * @brief Maximizes window's size.
+ * If this function is called with true, window will be resized with screen size.
+ * Otherwise window will be resized with previous size.
+ * It is for the window's MAX button in window's border.
+ *
+ * It is for client application.
+ * If window border is supported by display server, it is not necessary.
+ *
+ * @param[in] window The window instance.
+ * @param[in] maximize If window is maximized or unmaximized.
+ */
+DALI_ADAPTOR_API void Maximize(Window window, bool maximize);
+
+/**
+ * @brief Returns whether the window is maximized or not.
+ *
+ * @param[in] window The window instance.
+ * @return True if the window is maximized, false otherwise.
+ */
+DALI_ADAPTOR_API bool IsMaximized(Window window);
+
+/**
+ * @brief Minimizes window's size.
+ * If this function is called with true, window will be iconified.
+ * Otherwise window will be activated.
+ * It is for the window's MIN button in window border.
+ *
+ * It is for client application.
+ * If window border is supported by display server, it is not necessary.
+ *
+ * @param[in] window The window instance.
+ * @param[in] minimize If window is minimized or unminimized(activated).
+ */
+DALI_ADAPTOR_API void Minimize(Window window, bool minimize);
+
+/**
+ * @brief Returns whether the window is minimized or not.
+ *
+ * @param[in] window The window instance.
+ * @return True if the window is minimized, false otherwise.
+ */
+DALI_ADAPTOR_API bool IsMinimized(Window window);
+
} // namespace DevelWindow
} // namespace Dali
#ifndef DALI_PROFILE_UBUNTU
if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
{
- DALI_LOG_RELEASE_INFO("EglImplementation::SwapBuffers started.\n");
+ DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffers started. eglSurface(%p)\n", eglSurface);
}
#endif //DALI_PROFILE_UBUNTU
#ifndef DALI_PROFILE_UBUNTU
if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
{
- DALI_LOG_RELEASE_INFO("EglImplementation::SwapBuffers finished.\n");
+ DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffers finished.\n");
mSwapBufferCountAfterResume++;
}
#endif //DALI_PROFILE_UBUNTU
#ifndef DALI_PROFILE_UBUNTU
if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
{
- DALI_LOG_RELEASE_INFO("EglImplementation::SwapBuffers started.\n");
+ DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffersWithDamageKHR started. eglSurface(%p)\n", eglSurface);
}
#endif //DALI_PROFILE_UBUNTU
#ifndef DALI_PROFILE_UBUNTU
if(mSwapBufferCountAfterResume < THRESHOLD_SWAPBUFFER_COUNT)
{
- DALI_LOG_RELEASE_INFO("EglImplementation::SwapBuffers finished.\n");
+ DALI_LOG_RELEASE_INFO("EglImplementation::eglSwapBuffersWithDamageKHR finished.\n");
mSwapBufferCountAfterResume++;
}
#endif //DALI_PROFILE_UBUNTU
{
}
+void WindowBaseAndroid::Maximize(bool maximize)
+{
+}
+
+bool WindowBaseAndroid::IsMaximized() const
+{
+ return false;
+}
+
+void WindowBaseAndroid::Minimize(bool minimize)
+{
+}
+
+bool WindowBaseAndroid::IsMinimized() const
+{
+ return false;
+}
+
void WindowBaseAndroid::SetAvailableAnlges(const std::vector<int>& angles)
{
}
void Activate() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Maximize()
+ */
+ void Maximize(bool maximize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
+ */
+ bool IsMaximized() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
+ */
+ void Minimize(bool minimize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
+ */
+ bool IsMinimized() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
void SetAvailableAnlges(const std::vector<int>& angles) override;
virtual void Activate() = 0;
/**
+ * @copydoc Dali::DevelWindow::Maximize()
+ */
+ virtual void Maximize(bool maximize) = 0;
+
+ /**
+ * @copydoc Dali::DevelWindow::IsMaximized()
+ */
+ virtual bool IsMaximized() const = 0;
+
+ /**
+ * @copydoc Dali::DevelWindow::Minimize()
+ */
+ virtual void Minimize(bool minimize) = 0;
+
+ /**
+ * @copydoc Dali::DevelWindow::IsMinimized()
+ */
+ virtual bool IsMinimized() const = 0;
+
+ /**
* @copydoc Dali::Window::SetAvailableOrientations()
*/
virtual void SetAvailableAnlges(const std::vector<int>& angles) = 0;
DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Activate() \n", this, mNativeWindowId);
}
+void Window::Maximize(bool maximize)
+{
+ mWindowBase->Maximize(maximize);
+
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Maximize: %d\n", this, mNativeWindowId, maximize);
+}
+
+bool Window::IsMaximized() const
+{
+ return mWindowBase->IsMaximized();
+}
+
+void Window::Minimize(bool minimize)
+{
+ mWindowBase->Minimize(minimize);
+
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Minimize: %d\n", this, mNativeWindowId, minimize);
+}
+
+bool Window::IsMinimized() const
+{
+ return mWindowBase->IsMinimized();
+}
+
uint32_t Window::GetLayerCount() const
{
return mScene.GetLayerCount();
void Window::OnUpdatePositionSize(Dali::PositionSize& positionSize)
{
- SetPositionSize(positionSize);
+ PositionSize oldRect = mSurface->GetPositionSize();
+
+ mWindowSurface->UpdatePositionSize(positionSize);
+
+ PositionSize newRect = positionSize;
+
+ // When surface size is updated, inform adaptor of resizing and emit ResizeSignal
+ if((oldRect.width != newRect.width) || (oldRect.height != newRect.height))
+ {
+ Uint16Pair newSize(newRect.width, newRect.height);
+
+ SurfaceResized();
+
+ mAdaptor->SurfaceResizePrepare(mSurface.get(), newSize);
+
+ DALI_LOG_RELEASE_INFO("Window (%p), WinId (%d), Updated PositionSize by server :resize signal [%d x %d]\n", this, mNativeWindowId, newRect.width, newRect.height);
+ Dali::Window handle(this);
+ mResizeSignal.Emit(handle, newSize);
+ mAdaptor->SurfaceResizeComplete(mSurface.get(), newSize);
+ }
+
+ mSurface->SetFullSwapNextFrame();
+
+ Dali::Accessibility::Accessible::Get(mScene.GetRootLayer(), true)->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
}
void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
void Activate();
/**
+ * @copydoc Dali::DevelWindow::Maximize()
+ */
+ void Maximize(bool maximize);
+
+ /**
+ * @copydoc Dali::DevelWindow::IsMaximized()
+ */
+ bool IsMaximized() const;
+
+ /**
+ * @copydoc Dali::DevelWindow::Minimize()
+ */
+ void Minimize(bool minimize);
+
+ /**
+ * @copydoc Dali::DevelWindow::IsMinimized()
+ */
+ bool IsMinimized() const;
+
+ /**
* @copydoc Dali::Window::GetLayerCount()
*/
uint32_t GetLayerCount() const;
Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
mEGLSurface = eglImpl.CreateSurfaceWindow(window, mColorDepth);
- DALI_LOG_RELEASE_INFO("WindowRenderSurface::CreateSurface: WinId (%d), w = %d h = %d angle = %d screen rotation = %d\n",
+ DALI_LOG_RELEASE_INFO("WindowRenderSurface::CreateSurface: WinId (%d), EGLSurface (%p), w = %d h = %d angle = %d screen rotation = %d\n",
mWindowBase->GetNativeWindowId(),
+ mEGLSurface,
mPositionSize.width,
mPositionSize.height,
mWindowRotationAngle,
return eglImpl.ReplaceSurfaceWindow(window, mEGLSurface, mEGLContext);
}
+void WindowRenderSurface::UpdatePositionSize(Dali::PositionSize positionSize)
+{
+ bool needToMove = false;
+ bool needToResize = false;
+
+ // Check moving
+ if((fabs(positionSize.x - mPositionSize.x) >= MINIMUM_DIMENSION_CHANGE) ||
+ (fabs(positionSize.y - mPositionSize.y) >= MINIMUM_DIMENSION_CHANGE))
+ {
+ needToMove = true;
+ }
+
+ // Check resizing
+ if((fabs(positionSize.width - mPositionSize.width) >= MINIMUM_DIMENSION_CHANGE) ||
+ (fabs(positionSize.height - mPositionSize.height) >= MINIMUM_DIMENSION_CHANGE))
+ {
+ needToResize = true;
+ }
+
+ if(needToResize)
+ {
+ mResizeFinished = false;
+ mPositionSize = positionSize;
+ }
+ else
+ {
+ if(needToMove)
+ {
+ mPositionSize = positionSize;
+ }
+ }
+
+ DALI_LOG_INFO(gWindowRenderSurfaceLogFilter, Debug::Verbose, "WindowRenderSurface::MoveResize: %d, %d, %d, %d\n", mPositionSize.x, mPositionSize.y, mPositionSize.width, mPositionSize.height);
+}
+
void WindowRenderSurface::MoveResize(Dali::PositionSize positionSize)
{
bool needToMove = false;
void SetNeedsRotationCompletedAcknowledgement(bool needAcknowledgement);
/**
+ * @brief Updates window surface's position and size.
+ * It is just to update the local variable in window surface.
+ * This function is only called when window's position or size is changed by display server.
+ *
+ * @param[in] positionSize The updated window surface's position and size.
+ */
+ void UpdatePositionSize(Dali::PositionSize positionSize);
+
+ /**
* @brief This signal is emitted when the output is transformed.
*/
OutputSignalType& OutputTransformedSignal();
void Activate() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Maximize()
+ */
+ void Maximize(bool maximize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
+ */
+ bool IsMaximized() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
+ */
+ void Minimize(bool minimize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
+ */
+ bool IsMinimized() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
void SetAvailableAnlges(const std::vector<int>& angles) override;
[mImpl->mWinController showWindow:nil];
}
+void WindowBaseCocoa::Maximize(bool maximize)
+{
+}
+
+bool WindowBaseCocoa::IsMaximized() const
+{
+ return false;
+}
+
+void WindowBaseCocoa::Minimize(bool minimize)
+{
+}
+
+bool WindowBaseCocoa::IsMinimized() const
+{
+ return false;
+}
+
void WindowBaseCocoa::SetAvailableAnlges( const std::vector< int >& angles )
{
}
ecore_wl_window_activate(mEcoreWindow);
}
+void WindowBaseEcoreWl::Maximize(bool maximize)
+{
+}
+
+bool WindowBaseEcoreWl::IsMaximized() const
+{
+ return false;
+}
+
+void WindowBaseEcoreWl::Minimize(bool minimize)
+{
+}
+
+bool WindowBaseEcoreWl::IsMinimized() const
+{
+ return false;
+}
+
void WindowBaseEcoreWl::SetAvailableAnlges(const std::vector<int>& angles)
{
int rotations[4] = {0};
void Activate() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Maximize()
+ */
+ void Maximize(bool maximize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
+ */
+ bool IsMaximized() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
+ */
+ void Minimize(bool minimize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
+ */
+ bool IsMinimized() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
void SetAvailableAnlges(const std::vector<int>& angles) override;
if(windowMoved || windowResized)
{
Dali::PositionSize newPositionSize(ev->x, ev->y, newWidth, newHeight);
+ mWindowPositionSize = newPositionSize;
+ DALI_LOG_RELEASE_INFO("Update position & resize signal by server, x[%d] y[%d] w[%d] h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
mUpdatePositionSizeSignal.Emit(newPositionSize);
}
ecore_wl2_window_activate(mEcoreWindow);
}
+void WindowBaseEcoreWl2::Maximize(bool maximize)
+{
+ ecore_wl2_window_maximized_set(mEcoreWindow, maximize);
+}
+
+bool WindowBaseEcoreWl2::IsMaximized() const
+{
+ return ecore_wl2_window_maximized_get(mEcoreWindow);
+}
+
+void WindowBaseEcoreWl2::Minimize(bool minimize)
+{
+ ecore_wl2_window_iconified_set(mEcoreWindow, minimize);
+}
+
+bool WindowBaseEcoreWl2::IsMinimized() const
+{
+ return ecore_wl2_window_iconified_get(mEcoreWindow);
+}
+
void WindowBaseEcoreWl2::SetAvailableAnlges(const std::vector<int>& angles)
{
int rotations[4] = {0};
void Activate() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Maximize()
+ */
+ void Maximize(bool maximize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
+ */
+ bool IsMaximized() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
+ */
+ void Minimize(bool minimize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
+ */
+ bool IsMinimized() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
void SetAvailableAnlges(const std::vector<int>& angles) override;
ecore_x_netwm_client_active_request(ecore_x_window_root_get(mEcoreWindow), mEcoreWindow, 1 /* request type, 1:application, 2:pager */, 0);
}
+void WindowBaseEcoreX::Maximize(bool maximize)
+{
+}
+
+bool WindowBaseEcoreX::IsMaximized() const
+{
+ return false;
+}
+
+void WindowBaseEcoreX::Minimize(bool minimize)
+{
+}
+
+bool WindowBaseEcoreX::IsMinimized() const
+{
+ return false;
+}
+
void WindowBaseEcoreX::SetAvailableAnlges(const std::vector<int>& angles)
{
}
void Activate() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Maximize()
+ */
+ void Maximize(bool maximize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
+ */
+ bool IsMaximized() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
+ */
+ void Minimize(bool minimize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
+ */
+ bool IsMinimized() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
void SetAvailableAnlges(const std::vector<int>& angles) override;
{
}
+void WindowBaseWin::Maximize(bool maximize)
+{
+}
+
+bool WindowBaseWin::IsMaximized() const
+{
+ return false;
+}
+
+void WindowBaseWin::Minimize(bool minimize)
+{
+}
+
+bool WindowBaseWin::IsMinimized() const
+{
+ return false;
+}
+
void WindowBaseWin::SetAvailableAnlges(const std::vector<int>& angles)
{
}
void Activate() override;
/**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Maximize()
+ */
+ void Maximize(bool maximize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMaximized()
+ */
+ bool IsMaximized() const override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::Minimize()
+ */
+ void Minimize(bool minimize) override;
+
+ /**
+ * @copydoc Dali::Internal::Adaptor::WindowBase::IsMinimized()
+ */
+ bool IsMinimized() const override;
+
+ /**
* @copydoc Dali::Internal::Adaptor::WindowBase::SetAvailableAnlges()
*/
void SetAvailableAnlges(const std::vector<int>& angles) override;