RotationEvent rotationEvent;
rotationEvent.angle = ev->angle;
rotationEvent.winResize = 0;
+
+ if(ev->w == 0 || ev->h ==0)
+ {
+ // Use previous client side window's size.
+ if(mWindowRotationAngle == 90 || mWindowRotationAngle == 270)
+ {
+ ev->w = mWindowPositionSize.height;
+ ev->h = mWindowPositionSize.width;
+ }
+ else
+ {
+ ev->w = mWindowPositionSize.width;
+ ev->h = mWindowPositionSize.height;
+ }
+ }
+
mWindowRotationAngle = ev->angle;
if(ev->angle == 0 || ev->angle == 180)
{
Ecore_Wl2_Event_Window_Configure* ev(static_cast<Ecore_Wl2_Event_Window_Configure*>(event));
- if(ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+ if(ev && ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
{
// Note: To comply with the wayland protocol, Dali should make an ack_configure
// by calling ecore_wl2_window_commit
+
+ int tempWidth = static_cast<int>(ev->w);
+ int tempHeight = static_cast<int>(ev->h);
+
+ // Initialize with previous size for skip resize when new size is 0.
+ // When window is just moved or window is resized by client application,
+ // The configure notification event's size will be 0.
+ // If new size is 0, the resized work should be skip.
+ int newWidth = mWindowPositionSize.width;
+ int newHeight = mWindowPositionSize.height;
+ bool windowMoved = false, windowResized = false;
+
+ if(ev->x != mWindowPositionSize.x || ev->y != mWindowPositionSize.y)
+ {
+ windowMoved = true;
+ }
+
+ if(tempWidth != 0 && tempHeight != 0 && (tempWidth != mWindowPositionSize.width || tempHeight != mWindowPositionSize.height))
+ {
+ windowResized = true;
+ newWidth = tempWidth;
+ newHeight = tempHeight;
+ }
+
+ if(windowMoved || windowResized)
+ {
+ Dali::PositionSize newPositionSize(ev->x, ev->y, newWidth, newHeight);
+ mUpdatePositionSizeSignal.Emit(newPositionSize);
+ }
+
ecore_wl2_window_commit(mEcoreWindow, EINA_FALSE);
}
}
ecore_wl2_window_type_set(mEcoreWindow, windowType);
}
-bool WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level)
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetNotificationLevel(Dali::WindowNotificationLevel level)
{
while(!mTizenPolicy)
{
if(!mNotificationLevelChangeDone)
{
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level change is failed [%d, %d]\n", level, mNotificationChangeState);
- return false;
+ return Dali::WindowOperationResult::UNKNOWN_ERROR;
}
else if(mNotificationChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
{
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Permission denied! [%d]\n", level);
- return false;
+ return Dali::WindowOperationResult::PERMISSION_DENIED;
}
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetNotificationLevel: Level is changed [%d]\n", mNotificationLevel);
- return true;
+ return Dali::WindowOperationResult::SUCCEED;
}
Dali::WindowNotificationLevel WindowBaseEcoreWl2::GetNotificationLevel() const
tizen_policy_set_opaque_state(mTizenPolicy, ecore_wl2_window_surface_get(mEcoreWindow), (opaque ? 1 : 0));
}
-bool WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode)
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetScreenOffMode(WindowScreenOffMode screenOffMode)
{
while(!mTizenPolicy)
{
if(!mScreenOffModeChangeDone)
{
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode change is failed [%d, %d]\n", screenOffMode, mScreenOffModeChangeState);
- return false;
+ return Dali::WindowOperationResult::UNKNOWN_ERROR;
}
else if(mScreenOffModeChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
{
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Permission denied! [%d]\n", screenOffMode);
- return false;
+ return Dali::WindowOperationResult::PERMISSION_DENIED;
}
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetScreenOffMode: Screen mode is changed [%d]\n", mScreenOffMode);
- return true;
+ return Dali::WindowOperationResult::SUCCEED;
}
WindowScreenOffMode WindowBaseEcoreWl2::GetScreenOffMode() const
return screenMode;
}
-bool WindowBaseEcoreWl2::SetBrightness(int brightness)
+Dali::WindowOperationResult WindowBaseEcoreWl2::SetBrightness(int brightness)
{
while(!mTizenDisplayPolicy)
{
if(!mBrightnessChangeDone)
{
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness change is failed [%d, %d]\n", brightness, mBrightnessChangeState);
- return false;
+ return Dali::WindowOperationResult::UNKNOWN_ERROR;
}
else if(mBrightnessChangeState == TIZEN_POLICY_ERROR_STATE_PERMISSION_DENIED)
{
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Permission denied! [%d]\n", brightness);
- return false;
+ return Dali::WindowOperationResult::PERMISSION_DENIED;
}
DALI_LOG_INFO(gWindowBaseLogFilter, Debug::Verbose, "WindowBaseEcoreWl2::SetBrightness: Brightness is changed [%d]\n", mBrightness);
- return true;
+ return Dali::WindowOperationResult::SUCCEED;
}
int WindowBaseEcoreWl2::GetBrightness() const