From: Jiyun Yang Date: Wed, 16 Jan 2019 08:30:20 +0000 (+0900) Subject: Register a window configuration callback (Wayland2) to response properly X-Git-Tag: dali_1.4.4~2^2 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=d80ee7effb57c2b5256bf1a57c97eb5239cc86e4 Register a window configuration callback (Wayland2) to response properly Change-Id: Ib3320206cc42f3396172b2a25a119e3c9e943979 Signed-off-by: Jiyun Yang --- diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp index 84a8a2c..e648e6f 100755 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp @@ -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 ); diff --git a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h index 808c4f0..c18813c 100644 --- a/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h +++ b/dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.h @@ -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 );