[dali_2.3.31] Merge branch 'devel/master'
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / tizen-wayland / ecore-wl2 / window-base-ecore-wl2.cpp
index 2800176..2c19579 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2023 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.
@@ -462,6 +462,19 @@ static Eina_Bool EcoreEventMouseButtonMove(void* data, int type, void* event)
 /**
  * Called when a touch motion is received.
  */
+static Eina_Bool EcoreEventMouseFrame(void* data, int type, void* event)
+{
+  WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
+  if(windowBase)
+  {
+    windowBase->OnMouseFrame(data, type, event);
+  }
+  return ECORE_CALLBACK_PASS_ON;
+}
+
+/**
+ * Called when a touch motion is received.
+ */
 static Eina_Bool EcoreEventMouseButtonRelativeMove(void* data, int type, void* event)
 {
   WindowBaseEcoreWl2* windowBase = static_cast<WindowBaseEcoreWl2*>(data);
@@ -956,7 +969,14 @@ WindowBaseEcoreWl2::~WindowBaseEcoreWl2()
 
   if(mOwnSurface)
   {
-    ecore_wl2_window_free(mEcoreWindow);
+    try
+    {
+      ecore_wl2_window_free(mEcoreWindow);
+    }
+    catch(std::bad_weak_ptr const& ex)
+    {
+      DALI_LOG_ERROR("WindowBaseEcoreWl2::~WindowBaseEcoreWl2() - window (%p) std::bad_weak_ptr caught: %s\n", mEcoreWindow, ex.what());
+    }
   }
 }
 
@@ -1012,6 +1032,9 @@ void WindowBaseEcoreWl2::Initialize(PositionSize positionSize, Any surface, bool
 
   // Register pointer lock/unlock event
   mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_WL2_EVENT_POINTER_CONSTRAINTS, EcoreEventPointerConstraints, this));
+
+  // Register mouse frame events
+  mEcoreEventHandler.PushBack(ecore_event_handler_add(ECORE_EVENT_MOUSE_FRAME, EcoreEventMouseFrame, this));
 #endif
 
   // Register Mouse wheel events
@@ -1101,7 +1124,7 @@ Eina_Bool WindowBaseEcoreWl2::OnIconifyStateChanged(void* data, int type, void*
   Ecore_Wl2_Event_Window_Iconify_State_Change* iconifyChangedEvent(static_cast<Ecore_Wl2_Event_Window_Iconify_State_Change*>(event));
   Eina_Bool                                    handled(ECORE_CALLBACK_PASS_ON);
 
-  if(iconifyChangedEvent->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(iconifyChangedEvent->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     if(iconifyChangedEvent->iconified == EINA_TRUE)
     {
@@ -1123,7 +1146,7 @@ Eina_Bool WindowBaseEcoreWl2::OnFocusIn(void* data, int type, void* event)
 {
   Ecore_Wl2_Event_Focus_In* focusInEvent(static_cast<Ecore_Wl2_Event_Focus_In*>(event));
 
-  if(focusInEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(focusInEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnFocusIn, Window (%p) EcoreEventWindowFocusIn\n", mEcoreWindow);
 
@@ -1137,7 +1160,7 @@ Eina_Bool WindowBaseEcoreWl2::OnFocusOut(void* data, int type, void* event)
 {
   Ecore_Wl2_Event_Focus_Out* focusOutEvent(static_cast<Ecore_Wl2_Event_Focus_Out*>(event));
 
-  if(focusOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(focusOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnFocusOut, Window (%p) EcoreEventWindowFocusOut\n", mEcoreWindow);
 
@@ -1151,7 +1174,7 @@ Eina_Bool WindowBaseEcoreWl2::OnOutputTransform(void* data, int type, void* even
 {
   Ecore_Wl2_Event_Output_Transform* transformEvent(static_cast<Ecore_Wl2_Event_Output_Transform*>(event));
 
-  if(transformEvent->output == ecore_wl2_window_output_find(mEcoreWindow))
+  if(transformEvent->output == ecore_wl2_window_output_find(mEcoreWindow) && Dali::Adaptor::IsAvailable())
   {
     DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnOutputTransform, Window (%p) EcoreEventOutputTransform\n", mEcoreWindow);
 
@@ -1167,7 +1190,7 @@ Eina_Bool WindowBaseEcoreWl2::OnIgnoreOutputTransform(void* data, int type, void
 {
   Ecore_Wl2_Event_Ignore_Output_Transform* ignoreTransformEvent(static_cast<Ecore_Wl2_Event_Ignore_Output_Transform*>(event));
 
-  if(ignoreTransformEvent->win == mEcoreWindow)
+  if(ignoreTransformEvent->win == mEcoreWindow && Dali::Adaptor::IsAvailable())
   {
     DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnIgnoreOutputTransform, Window (%p) EcoreEventIgnoreOutputTransform\n", mEcoreWindow);
 
@@ -1183,7 +1206,7 @@ void WindowBaseEcoreWl2::OnRotation(void* data, int type, void* event)
 {
   Ecore_Wl2_Event_Window_Rotation* ev(static_cast<Ecore_Wl2_Event_Window_Rotation*>(event));
 
-  if(ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnRotation, Window (%p), angle: %d, width: %d, height: %d\n", mEcoreWindow, ev->angle, ev->w, ev->h);
 
@@ -1219,7 +1242,7 @@ void WindowBaseEcoreWl2::OnConfiguration(void* data, int type, void* event)
 {
   Ecore_Wl2_Event_Window_Configure* ev(static_cast<Ecore_Wl2_Event_Window_Configure*>(event));
 
-  if(ev && 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)) && Dali::Adaptor::IsAvailable())
   {
     // Note: To comply with the wayland protocol, Dali should make an ack_configure
     // by calling ecore_wl2_window_commit
@@ -1271,7 +1294,7 @@ void WindowBaseEcoreWl2::OnMouseButtonDown(void* data, int type, void* event)
 {
   Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
 
-  if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_DOWN");
 
@@ -1306,6 +1329,10 @@ void WindowBaseEcoreWl2::OnMouseButtonDown(void* data, int type, void* event)
     point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+    mMouseFrameEventSignal.Emit();
+#endif
   }
 }
 
@@ -1313,7 +1340,7 @@ void WindowBaseEcoreWl2::OnMouseButtonUp(void* data, int type, void* event)
 {
   Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
 
-  if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_UP");
 
@@ -1335,6 +1362,10 @@ void WindowBaseEcoreWl2::OnMouseButtonUp(void* data, int type, void* event)
     point.SetMouseButton(static_cast<MouseButton::Type>(touchEvent->buttons));
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+    mMouseFrameEventSignal.Emit();
+#endif
   }
 }
 
@@ -1342,7 +1373,7 @@ void WindowBaseEcoreWl2::OnMouseButtonMove(void* data, int type, void* event)
 {
   Ecore_Event_Mouse_Move* touchEvent = static_cast<Ecore_Event_Mouse_Move*>(event);
 
-  if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_MOVE");
 
@@ -1363,15 +1394,30 @@ void WindowBaseEcoreWl2::OnMouseButtonMove(void* data, int type, void* event)
     point.SetDeviceSubclass(deviceSubclass);
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
+
+#ifndef OVER_TIZEN_VERSION_8
+    mMouseFrameEventSignal.Emit();
+#endif
   }
 }
 
 #ifdef OVER_TIZEN_VERSION_8
+void WindowBaseEcoreWl2::OnMouseFrame(void* data, int type, void* event)
+{
+  Ecore_Event_Mouse_Frame* MouseFrameEvent = static_cast<Ecore_Event_Mouse_Frame*>(event);
+
+  if(MouseFrameEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
+  {
+    DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_FRAME");
+    mMouseFrameEventSignal.Emit();
+  }
+}
+
 void WindowBaseEcoreWl2::OnMouseButtonRelativeMove(void* data, int type, void* event)
 {
   Ecore_Event_Mouse_Relative_Move* relativeMoveEvent = static_cast<Ecore_Event_Mouse_Relative_Move*>(event);
 
-  if(relativeMoveEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(relativeMoveEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_RELATIVE_MOVE");
 
@@ -1392,17 +1438,32 @@ void WindowBaseEcoreWl2::OnMouseButtonCancel(void* data, int type, void* event)
 {
   Ecore_Event_Mouse_Button* touchEvent = static_cast<Ecore_Event_Mouse_Button*>(event);
 
-  if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(touchEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_CANCEL");
 
+    Device::Class::Type    deviceClass;
+    Device::Subclass::Type deviceSubclass;
+
+    GetDeviceClass(ecore_device_class_get(touchEvent->dev), deviceClass);
+    GetDeviceSubclass(ecore_device_subclass_get(touchEvent->dev), deviceSubclass);
+
     Integration::Point point;
     point.SetDeviceId(touchEvent->multi.device);
     point.SetState(PointState::INTERRUPTED);
-    point.SetScreenPosition(Vector2(0.0f, 0.0f));
+    point.SetScreenPosition(Vector2(touchEvent->x, touchEvent->y));
+    point.SetRadius(touchEvent->multi.radius, Vector2(touchEvent->multi.radius_x, touchEvent->multi.radius_y));
+    point.SetPressure(touchEvent->multi.pressure);
+    point.SetAngle(Degree(touchEvent->multi.angle));
+    point.SetDeviceClass(deviceClass);
+    point.SetDeviceSubclass(deviceSubclass);
 
     mTouchEventSignal.Emit(point, touchEvent->timestamp);
 
+#ifndef OVER_TIZEN_VERSION_8
+    mMouseFrameEventSignal.Emit();
+#endif
+
     DALI_LOG_INFO(gWindowBaseLogFilter, Debug::General, "WindowBaseEcoreWl2::OnMouseButtonCancel\n");
   }
 }
@@ -1412,7 +1473,7 @@ void WindowBaseEcoreWl2::OnPointerConstraints(void* data, int type, void* event)
 {
   Ecore_Wl2_Event_Pointer_Constraints* constraintsEvent = static_cast<Ecore_Wl2_Event_Pointer_Constraints*>(event);
 
-  if(constraintsEvent && constraintsEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(constraintsEvent && constraintsEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_POINTER_CONSTRAINTS");
     Dali::Int32Pair position(constraintsEvent->x, constraintsEvent->y);
@@ -1427,7 +1488,7 @@ void WindowBaseEcoreWl2::OnMouseWheel(void* data, int type, void* event)
 {
   Ecore_Event_Mouse_Wheel* mouseWheelEvent = static_cast<Ecore_Event_Mouse_Wheel*>(event);
 
-  if(mouseWheelEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(mouseWheelEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_WHEEL");
 
@@ -1443,7 +1504,7 @@ void WindowBaseEcoreWl2::OnMouseInOut(void* data, int type, void* event, Dali::D
 {
   Ecore_Event_Mouse_IO* mouseInOutEvent = static_cast<Ecore_Event_Mouse_IO*>(event);
 
-  if(mouseInOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(mouseInOutEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     DALI_TRACE_SCOPE(gTraceFilter, "DALI_ON_MOUSE_IN_OUT");
 
@@ -1466,19 +1527,21 @@ void WindowBaseEcoreWl2::OnDetentRotation(void* data, int type, void* event)
   Ecore_Event_Detent_Rotate* detentEvent = static_cast<Ecore_Event_Detent_Rotate*>(event);
 
   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnDetentRotation, Window (%p)\n", mEcoreWindow);
+  if(Dali::Adaptor::IsAvailable())
+  {
+    int32_t clockwise = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
 
-  int32_t clockwise = (detentEvent->direction == ECORE_DETENT_DIRECTION_CLOCKWISE) ? 1 : -1;
-
-  Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, detentEvent->direction, 0, Vector2(0.0f, 0.0f), clockwise, detentEvent->timestamp);
+    Integration::WheelEvent wheelEvent(Integration::WheelEvent::CUSTOM_WHEEL, detentEvent->direction, 0, Vector2(0.0f, 0.0f), clockwise, detentEvent->timestamp);
 
-  mWheelEventSignal.Emit(wheelEvent);
+    mWheelEventSignal.Emit(wheelEvent);
+  }
 }
 
 void WindowBaseEcoreWl2::OnKeyDown(void* data, int type, void* event)
 {
   Ecore_Event_Key* keyEvent = static_cast<Ecore_Event_Key*>(event);
 
-  if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     std::string keyName(keyEvent->keyname);
     std::string logicalKey("");
@@ -1540,6 +1603,7 @@ void WindowBaseEcoreWl2::OnKeyDown(void* data, int type, void* event)
 
     Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::DOWN, compose, deviceName, deviceClass, deviceSubclass);
     keyEvent.isRepeat = isRepeat;
+    keyEvent.windowId = GetNativeWindowId();
 
     mKeyEventSignal.Emit(keyEvent);
   }
@@ -1549,7 +1613,7 @@ void WindowBaseEcoreWl2::OnKeyUp(void* data, int type, void* event)
 {
   Ecore_Event_Key* keyEvent = static_cast<Ecore_Event_Key*>(event);
 
-  if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(keyEvent->window == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
 #if defined(ECORE_VERSION_MAJOR) && (ECORE_VERSION_MAJOR >= 1) && defined(ECORE_VERSION_MINOR) && (ECORE_VERSION_MINOR >= 23)
     // Cancel processing flag is sent because this key event will combine with the previous key. So, the event should not actually perform anything.
@@ -1611,6 +1675,7 @@ void WindowBaseEcoreWl2::OnKeyUp(void* data, int type, void* event)
     GetDeviceSubclass(ecore_device_subclass_get(keyEvent->dev), deviceSubclass);
 
     Integration::KeyEvent keyEvent(keyName, logicalKey, keyString, keyCode, modifier, time, Integration::KeyEvent::UP, compose, deviceName, deviceClass, deviceSubclass);
+    keyEvent.windowId = GetNativeWindowId();
 
     mKeyEventSignal.Emit(keyEvent);
   }
@@ -1618,162 +1683,190 @@ void WindowBaseEcoreWl2::OnKeyUp(void* data, int type, void* event)
 
 void WindowBaseEcoreWl2::OnDataSend(void* data, int type, void* event)
 {
-  mSelectionDataSendSignal.Emit(event);
+  if(Dali::Adaptor::IsAvailable())
+  {
+    mSelectionDataSendSignal.Emit(event);
+  }
 }
 
 void WindowBaseEcoreWl2::OnDataReceive(void* data, int type, void* event)
 {
-  mSelectionDataReceivedSignal.Emit(event);
+  if(Dali::Adaptor::IsAvailable())
+  {
+    mSelectionDataReceivedSignal.Emit(event);
+  }
 }
 
 void WindowBaseEcoreWl2::OnFontNameChanged()
 {
-  mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_CHANGE);
+  if(Dali::Adaptor::IsAvailable())
+  {
+    mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_CHANGE);
+  }
 }
 
 void WindowBaseEcoreWl2::OnFontSizeChanged()
 {
-  mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+  if(Dali::Adaptor::IsAvailable())
+  {
+    mStyleChangedSignal.Emit(StyleChange::DEFAULT_FONT_SIZE_CHANGE);
+  }
 }
 
 void WindowBaseEcoreWl2::OnTransitionEffectEvent(WindowEffectState state, WindowEffectType type)
 {
   DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnTransitionEffectEvent, Window (%p)\n", mEcoreWindow);
-  mTransitionEffectEventSignal.Emit(state, type);
+
+  if(Dali::Adaptor::IsAvailable())
+  {
+    mTransitionEffectEventSignal.Emit(state, type);
+  }
 }
 
 void WindowBaseEcoreWl2::OnKeyboardRepeatSettingsChanged()
 {
-  mKeyboardRepeatSettingsChangedSignal.Emit();
+  if(Dali::Adaptor::IsAvailable())
+  {
+    mKeyboardRepeatSettingsChangedSignal.Emit();
+  }
 }
 
 void WindowBaseEcoreWl2::OnEcoreEventWindowRedrawRequest()
 {
-  mWindowRedrawRequestSignal.Emit();
+  if(Dali::Adaptor::IsAvailable())
+  {
+    mWindowRedrawRequestSignal.Emit();
+  }
 }
 
 void WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage(void* event)
 {
-  Ecore_Wl2_Event_Aux_Message* message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
-  if(message)
+  if(Dali::Adaptor::IsAvailable())
   {
-    DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, Window (%p), key:%s, value:%s \n", mEcoreWindow, message->key, message->val);
-    std::string           key(message->key);
-    std::string           value(message->val);
-    Dali::Property::Array options;
-
-    if(message->options)
+    Ecore_Wl2_Event_Aux_Message* message = static_cast<Ecore_Wl2_Event_Aux_Message*>(event);
+    if(message)
     {
-      Eina_List* l;
-      void*      data;
-      EINA_LIST_FOREACH(message->options, l, data)
+      DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, Window (%p), key:%s, value:%s \n", mEcoreWindow, message->key, message->val);
+      std::string           key(message->key);
+      std::string           value(message->val);
+      Dali::Property::Array options;
+
+      if(message->options)
       {
-        DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, Window (%p), option: %s\n", mEcoreWindow, (char*)data);
-        std::string option(static_cast<char*>(data));
-        options.Add(option);
+        Eina_List* l;
+        void*      data;
+        EINA_LIST_FOREACH(message->options, l, data)
+        {
+          DALI_LOG_RELEASE_INFO("WindowBaseEcoreWl2::OnEcoreEventWindowAuxiliaryMessage, Window (%p), option: %s\n", mEcoreWindow, (char*)data);
+          std::string option(static_cast<char*>(data));
+          options.Add(option);
+        }
       }
-    }
 
-    mAuxiliaryMessageSignal.Emit(key, value, options);
+      mAuxiliaryMessageSignal.Emit(key, value, options);
+    }
   }
 }
 
 void WindowBaseEcoreWl2::OnEcoreEventConformantChange(void* event)
 {
-  Ecore_Wl2_Event_Conformant_Change* ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(event);
-  if(ev && ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(Dali::Adaptor::IsAvailable())
   {
-    WindowInsetsPartType partType = WindowInsetsPartType::STATUS_BAR;
+    Ecore_Wl2_Event_Conformant_Change* ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(event);
+    if(ev && ev->win == static_cast<unsigned int>(ecore_wl2_window_id_get(mEcoreWindow)))
+    {
+      WindowInsetsPartType partType = WindowInsetsPartType::STATUS_BAR;
 
-    int x = 0;
-    int y = 0;
-    int w = 0;
-    int h = 0;
+      int x = 0;
+      int y = 0;
+      int w = 0;
+      int h = 0;
 
-    switch(ev->part_type)
-    {
-      case ECORE_WL2_INDICATOR_PART:
-      {
-        partType = WindowInsetsPartType::STATUS_BAR;
-        ecore_wl2_window_indicator_geometry_get(mEcoreWindow, &x, &y, &w, &h);
-        break;
-      }
-      case ECORE_WL2_KEYBOARD_PART:
-      {
-        partType = WindowInsetsPartType::KEYBOARD;
-        ecore_wl2_window_keyboard_geometry_get(mEcoreWindow, &x, &y, &w, &h);
-        break;
-      }
-      case ECORE_WL2_CLIPBOARD_PART:
+      switch(ev->part_type)
       {
-        partType = WindowInsetsPartType::CLIPBOARD;
-        ecore_wl2_window_clipboard_geometry_get(mEcoreWindow, &x, &y, &w, &h);
-        break;
-      }
-      default:
-      {
-        break;
+        case ECORE_WL2_INDICATOR_PART:
+        {
+          partType = WindowInsetsPartType::STATUS_BAR;
+          ecore_wl2_window_indicator_geometry_get(mEcoreWindow, &x, &y, &w, &h);
+          break;
+        }
+        case ECORE_WL2_KEYBOARD_PART:
+        {
+          partType = WindowInsetsPartType::KEYBOARD;
+          ecore_wl2_window_keyboard_geometry_get(mEcoreWindow, &x, &y, &w, &h);
+          break;
+        }
+        case ECORE_WL2_CLIPBOARD_PART:
+        {
+          partType = WindowInsetsPartType::CLIPBOARD;
+          ecore_wl2_window_clipboard_geometry_get(mEcoreWindow, &x, &y, &w, &h);
+          break;
+        }
+        default:
+        {
+          break;
+        }
       }
-    }
 
-    WindowInsetsPartState partState = WindowInsetsPartState::INVISIBLE;
+      WindowInsetsPartState partState = WindowInsetsPartState::INVISIBLE;
 
-    int left   = 0;
-    int right  = 0;
-    int top    = 0;
-    int bottom = 0;
+      int left   = 0;
+      int right  = 0;
+      int top    = 0;
+      int bottom = 0;
 
-    // Insets are applied only if system UI(e.g. virtual keyboard) satisfies the following 2 conditions.
-    // 1. System UI fits to the window width or height.
-    // 2. System UI begins or ends from the edge of window.
-    // Otherwise, we should not resize window content because there would be empty space around system UI.
-    bool applyInsets = false;
+      // Insets are applied only if system UI(e.g. virtual keyboard) satisfies the following 2 conditions.
+      // 1. System UI fits to the window width or height.
+      // 2. System UI begins or ends from the edge of window.
+      // Otherwise, we should not resize window content because there would be empty space around system UI.
+      bool applyInsets = false;
 
-    // Zero insets are applied if state is invisible
-    if(!ev->state)
-    {
-      applyInsets = true;
-    }
-    else
-    {
-      partState = WindowInsetsPartState::VISIBLE;
-
-      int winX = mWindowPositionSize.x;
-      int winY = mWindowPositionSize.y;
-      int winW = mWindowPositionSize.width;
-      int winH = mWindowPositionSize.height;
-
-      if((x <= winX) && (x + w >= winX + winW))
+      // Zero insets are applied if state is invisible
+      if(!ev->state)
       {
-        if((y <= winY) && (y + h >= winY) && (y + h <= winY + winH))
-        {
-          top         = y + h - winY;
-          applyInsets = true;
-        }
-        else if((y + h >= winY + winH) && (y >= winY) && (y <= winY + winH))
-        {
-          bottom      = winY + winH - y;
-          applyInsets = true;
-        }
+        applyInsets = true;
       }
-      else if((y <= winY) && (y + h >= winY + winH))
+      else
       {
-        if((x <= winX) && (x + w >= winX) && (x + w <= winX + winW))
+        partState = WindowInsetsPartState::VISIBLE;
+
+        int winX = mWindowPositionSize.x;
+        int winY = mWindowPositionSize.y;
+        int winW = mWindowPositionSize.width;
+        int winH = mWindowPositionSize.height;
+
+        if((x <= winX) && (x + w >= winX + winW))
         {
-          left        = x + w - winX;
-          applyInsets = true;
+          if((y <= winY) && (y + h >= winY) && (y + h <= winY + winH))
+          {
+            top         = y + h - winY;
+            applyInsets = true;
+          }
+          else if((y + h >= winY + winH) && (y >= winY) && (y <= winY + winH))
+          {
+            bottom      = winY + winH - y;
+            applyInsets = true;
+          }
         }
-        else if((x + w >= winX + winW) && (x >= winX) && (x <= winX + winW))
+        else if((y <= winY) && (y + h >= winY + winH))
         {
-          right       = winX + winW - x;
-          applyInsets = true;
+          if((x <= winX) && (x + w >= winX) && (x + w <= winX + winW))
+          {
+            left        = x + w - winX;
+            applyInsets = true;
+          }
+          else if((x + w >= winX + winW) && (x >= winX) && (x <= winX + winW))
+          {
+            right       = winX + winW - x;
+            applyInsets = true;
+          }
         }
       }
-    }
 
-    if(applyInsets)
-    {
-      mInsetsChangedSignal.Emit(partType, partState, Extents(left, right, top, bottom));
+      if(applyInsets)
+      {
+        mInsetsChangedSignal.Emit(partType, partState, Extents(left, right, top, bottom));
+      }
     }
   }
 }
@@ -1792,7 +1885,7 @@ void WindowBaseEcoreWl2::KeymapChanged(void* data, int type, void* event)
 void WindowBaseEcoreWl2::OnMoveCompleted(void* event)
 {
   Ecore_Wl2_Event_Window_Interactive_Move_Done* movedDoneEvent = static_cast<Ecore_Wl2_Event_Window_Interactive_Move_Done*>(event);
-  if(movedDoneEvent && movedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(movedDoneEvent && movedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     Dali::PositionSize orgPositionSize(movedDoneEvent->x, movedDoneEvent->y, movedDoneEvent->w, movedDoneEvent->h);
     Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(orgPositionSize);
@@ -1805,7 +1898,7 @@ void WindowBaseEcoreWl2::OnMoveCompleted(void* event)
 void WindowBaseEcoreWl2::OnResizeCompleted(void* event)
 {
   Ecore_Wl2_Event_Window_Interactive_Resize_Done* resizedDoneEvent = static_cast<Ecore_Wl2_Event_Window_Interactive_Resize_Done*>(event);
-  if(resizedDoneEvent && resizedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)))
+  if(resizedDoneEvent && resizedDoneEvent->win == static_cast<uint32_t>(ecore_wl2_window_id_get(mEcoreWindow)) && Dali::Adaptor::IsAvailable())
   {
     Dali::PositionSize orgPositionSize(resizedDoneEvent->x, resizedDoneEvent->y, resizedDoneEvent->w, resizedDoneEvent->h);
     Dali::PositionSize newPositionSize = RecalculatePositionSizeToCurrentOrientation(orgPositionSize);
@@ -1929,8 +2022,9 @@ void WindowBaseEcoreWl2::TizenPolicyConformantArea(void* data, struct tizen_poli
   {
     Ecore_Wl2_Event_Conformant_Change* ev = static_cast<Ecore_Wl2_Event_Conformant_Change*>(calloc(1, sizeof(Ecore_Wl2_Event_Conformant_Change)));
 
-    if(!ev)
+    if(DALI_UNLIKELY(!ev))
     {
+      DALI_LOG_ERROR("Failed to allocate Ecore_Wl2_Event_Conformant_Change. calloc size : %zu\n", sizeof(Ecore_Wl2_Event_Conformant_Change));
       return;
     }
     ev->win       = GetNativeWindowId();
@@ -3575,6 +3669,36 @@ void WindowBaseEcoreWl2::SetEglWindowFrontBufferMode(bool enable)
   wl_egl_window_tizen_set_frontbuffer_mode(mEglWindow, enable);
 }
 
+void WindowBaseEcoreWl2::SetModal(bool modal)
+{
+  DALI_LOG_RELEASE_INFO("ecore_wl2_window_modal_set, window: [%p], flag [%d]\n", mEcoreWindow, modal);
+  START_DURATION_CHECK();
+  ecore_wl2_window_modal_set(mEcoreWindow, modal);
+  FINISH_DURATION_CHECK("ecore_wl2_window_modal_set");
+}
+
+bool WindowBaseEcoreWl2::IsModal()
+{
+  bool ret = ecore_wl2_window_modal_get(mEcoreWindow);
+  DALI_LOG_RELEASE_INFO("ecore_wl2_window_modal_get, window: [%p], flag [%d]\n", mEcoreWindow, ret);
+  return ret;
+}
+
+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);
+  FINISH_DURATION_CHECK("ecore_wl2_window_pin_mode_set");
+}
+
+bool WindowBaseEcoreWl2::IsAlwaysOnTop()
+{
+  bool ret = ecore_wl2_window_pin_mode_get(mEcoreWindow);
+  DALI_LOG_RELEASE_INFO("ecore_wl2_window_pin_mode_get, window: [%p], flag [%d]\n", mEcoreWindow, ret);
+  return ret;
+}
+
 } // namespace Adaptor
 
 } // namespace Internal