Register a window configuration callback (Wayland2) to response properly 74/197774/2
authorJiyun Yang <ji.yang@samsung.com>
Wed, 16 Jan 2019 08:30:20 +0000 (17:30 +0900)
committerJiyun Yang <ji.yang@samsung.com>
Wed, 16 Jan 2019 08:33:00 +0000 (17:33 +0900)
Change-Id: Ib3320206cc42f3396172b2a25a119e3c9e943979
Signed-off-by: Jiyun Yang <ji.yang@samsung.com>
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h

index 84a8a2c..e648e6f 100755 (executable)
@@ -277,6 +277,19 @@ static Eina_Bool EcoreEventRotate( void* data, int type, void* event )
   return ECORE_CALLBACK_PASS_ON;
 }
 
+/**
+ * Called when configure event is recevied.
+ */
+static Eina_Bool EcoreEventConfigure( void* data, int type, void* event )
+{
+  WindowBaseEcoreWl2* windowBase = static_cast< WindowBaseEcoreWl2* >( data );
+  if( windowBase )
+  {
+    windowBase->OnConfiguration( data, type, event );
+  }
+  return ECORE_CALLBACK_PASS_ON;
+}
+
 /////////////////////////////////////////////////////////////////////////////////////////////////
 // Touch Callbacks
 /////////////////////////////////////////////////////////////////////////////////////////////////
@@ -689,6 +702,9 @@ void WindowBaseEcoreWl2::Initialize( PositionSize positionSize, Any surface, boo
   // Register Rotate event
   mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_ROTATE,               EcoreEventRotate,                    this ) );
 
+  // Register Configure event
+  mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_WL2_EVENT_WINDOW_CONFIGURE,            EcoreEventConfigure,                 this ) );
+
   // Register Touch events
   mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_DOWN,               EcoreEventMouseButtonDown,           this ) );
   mEcoreEventHandler.PushBack( ecore_event_handler_add( ECORE_EVENT_MOUSE_BUTTON_UP,                 EcoreEventMouseButtonUp,             this ) );
@@ -861,6 +877,18 @@ void WindowBaseEcoreWl2::OnRotation( void* data, int type, void* event )
   }
 }
 
+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->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
+    ecore_wl2_window_commit(mEcoreWindow, EINA_FALSE);
+  }
+}
+
 void WindowBaseEcoreWl2::OnMouseButtonDown( void* data, int type, void* event )
 {
   Ecore_Event_Mouse_Button* touchEvent = static_cast< Ecore_Event_Mouse_Button* >( event );
index 808c4f0..c18813c 100644 (file)
@@ -91,6 +91,11 @@ public:
   void OnRotation( void* data, int type, void* event );
 
   /**
+   * @brief Called when a configure event is recevied.
+   */
+  void OnConfiguration( void* data, int type, void* event );
+
+  /**
    * @brief Called when a touch down is received.
    */
   void OnMouseButtonDown( void* data, int type, void* event );