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 84a8a2c8e17edd1c9db81a8d1c250a02545cefe5..e648e6f54579340fc2e0632d1f02b147e7ea8f7b 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 808c4f0d540c8b3df624c2746880f0826cff59ae..c18813c20d61570679eeb20f2cfaf7d157edaaaa 100644 (file)
@@ -90,6 +90,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.
    */