Replace set geometry function when window configure notifcation event occurs.
From ecore_wl2_window_sync_geometry_set() to ecore_wl2_window_geometry_set().
It is for only tizen window backend.
Change-Id: I9bf4f0748e9393af21f70213341fb0d5655a4f51
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);
+
+ mWindowWidth = newRect.width;
+ mWindowHeight = 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())->EmitBoundsChanged(Dali::Rect<>(positionSize.x, positionSize.y, positionSize.width, positionSize.height));
}
void Window::OnTouchPoint(Dali::Integration::Point& point, int timeStamp)
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 Query whether window is rotating or not.
*
* @return true if window is rotating, false otherwise.
if(windowMoved || windowResized)
{
- mWindowPositionSize.x = ev->x;
- mWindowPositionSize.y = ev->y;
- mWindowPositionSize.width = newWidth;
+ mWindowPositionSize.x = ev->x;
+ mWindowPositionSize.y = ev->y;
+ mWindowPositionSize.width = newWidth;
mWindowPositionSize.height = newHeight;
DALI_LOG_RELEASE_INFO("Update position & resize signal by server, current angle [%d] x[%d] y[%d] w[%d] h[%d]\n", mWindowRotationAngle, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
+ ecore_wl2_window_geometry_set(mEcoreWindow, mWindowPositionSize.x, mWindowPositionSize.y, mWindowPositionSize.width, mWindowPositionSize.height);
+
Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(mWindowPositionSize);
DALI_LOG_RELEASE_INFO("emit signal to update window's position and size, x[%d] y[%d] w[%d] h[%d]\n", newPositionSize.x, newPositionSize.y, newPositionSize.width, newPositionSize.height);
mUpdatePositionSizeSignal.Emit(newPositionSize);