From f8ec92df5f0ecbfc17741b4d009d49f65a6ecfde Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Wed, 4 Jan 2017 14:13:06 +0900 Subject: [PATCH] Revert "[Tizen] Modify iconify part for wayland" This reverts commit 7a3284c4213a4e3b705a8c2440fd8e9c8ffdc72c. Change-Id: I2c97ff3d88fa600700be575f19c76f30a93f9531 --- adaptors/ecore/wayland/window-impl-ecore-wl.cpp | 47 ++++------------------ .../wayland/window-render-surface-ecore-wl.cpp | 20 ++++++++- adaptors/ecore/wayland/window-render-surface.h | 9 ++++- 3 files changed, 34 insertions(+), 42 deletions(-) diff --git a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp index 184299c..3cc1f20 100644 --- a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp @@ -63,7 +63,7 @@ struct Window::EventHandler EventHandler( Window* window ) : mWindow( window ), mWindowPropertyHandler( NULL ), - mWindowIconifyStateHandler( NULL ), + mClientMessageHandler( NULL ), mEcoreWindow( 0 ) { // store ecore window handle @@ -73,14 +73,6 @@ struct Window::EventHandler mEcoreWindow = wlWindow->GetWlWindow(); } DALI_ASSERT_ALWAYS( mEcoreWindow != 0 && "There is no ecore Wl window"); - -#ifndef DALI_PROFILE_UBUNTU - if( mWindow->mEcoreEventHander ) - { - mWindowIconifyStateHandler = ecore_event_handler_add( ECORE_WL_EVENT_WINDOW_ICONIFY_STATE_CHANGE, EcoreEventWindowIconifyStateChanged, this ); - } -#endif - } /** @@ -92,9 +84,9 @@ struct Window::EventHandler { ecore_event_handler_del( mWindowPropertyHandler ); } - if ( mWindowIconifyStateHandler ) + if ( mClientMessageHandler ) { - ecore_event_handler_del( mWindowIconifyStateHandler ); + ecore_event_handler_del( mClientMessageHandler ); } } @@ -106,41 +98,16 @@ struct Window::EventHandler return EINA_FALSE; } -#ifndef DALI_PROFILE_UBUNTU - /// Called when the window iconify state is changed. - static Eina_Bool EcoreEventWindowIconifyStateChanged( void* data, int type, void* event ) + /// Called when the window properties are changed. + static Eina_Bool EcoreEventClientMessage( void* data, int type, void* event ) { - Ecore_Wl_Event_Window_Iconify_State_Change* iconifyChangedEvent( (Ecore_Wl_Event_Window_Iconify_State_Change*)event ); - EventHandler* handler( (EventHandler*)data ); - Eina_Bool handled( ECORE_CALLBACK_PASS_ON ); - - if ( handler && handler->mWindow ) - { - WindowVisibilityObserver* observer( handler->mWindow->mAdaptor ); - if ( observer && ( iconifyChangedEvent->win == (unsigned int) ecore_wl_window_id_get( handler->mEcoreWindow ) ) ) - { - if( iconifyChangedEvent->iconified == EINA_TRUE ) - { - observer->OnWindowHidden(); - DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Iconfied\n", handler->mEcoreWindow ); - } - else - { - observer->OnWindowShown(); - DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window (%d) Shown\n", handler->mEcoreWindow ); - } - handled = ECORE_CALLBACK_DONE; - } - } - - return handled; + return EINA_FALSE; } -#endif // Data Window* mWindow; Ecore_Event_Handler* mWindowPropertyHandler; - Ecore_Event_Handler* mWindowIconifyStateHandler; + Ecore_Event_Handler* mClientMessageHandler; Ecore_Wl_Window* mEcoreWindow; }; diff --git a/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp b/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp index 892f6cc..0d0609a 100644 --- a/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp @@ -50,7 +50,9 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, const std::string& name, bool isTransparent) : EcoreWlRenderSurface( positionSize, surface, name, isTransparent ), - mEglWindow( NULL ) + mWlWindow( NULL ), + mEglWindow( NULL ), + mNeedToApproveDeiconify( false ) { DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" ); Init( surface ); @@ -87,6 +89,11 @@ Ecore_Wl_Window* WindowRenderSurface::GetWlWindow() return mWlWindow; } +void WindowRenderSurface::RequestToApproveDeiconify() +{ + mNeedToApproveDeiconify = true; +} + void WindowRenderSurface::InitializeEgl( EglInterface& eglIf ) { DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter ); @@ -214,6 +221,17 @@ void WindowRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstract { mRenderNotification->Trigger(); } + + // When the window is deiconified, it approves the deiconify operation to window manager after rendering + if(mNeedToApproveDeiconify) + { + // SwapBuffer is desychronized. So make sure to sychronize when window is deiconified. + glAbstraction.Finish(); + + //FIXME + + mNeedToApproveDeiconify = false; + } } void WindowRenderSurface::StopRender() diff --git a/adaptors/ecore/wayland/window-render-surface.h b/adaptors/ecore/wayland/window-render-surface.h index 8fa093a..7aea88b 100644 --- a/adaptors/ecore/wayland/window-render-surface.h +++ b/adaptors/ecore/wayland/window-render-surface.h @@ -61,6 +61,12 @@ public: // API virtual Ecore_Wl_Window* GetDrawable(); /** + * Request to approve deiconify operation + * If it is requested, it will send ECORE_X_ATOM_E_DEICONIFY_APPROVE event to window manager after rendering + */ + void RequestToApproveDeiconify(); + + /** * Map window */ virtual void Map(); @@ -153,6 +159,7 @@ private: // Data Ecore_Wl_Window* mWlWindow; ///< Wayland-Window wl_egl_window* mEglWindow; + bool mNeedToApproveDeiconify; ///< Whether need to send ECORE_X_ATOM_E_DEICONIFY_APPROVE event }; // class WindowRenderSurface @@ -160,4 +167,4 @@ private: // Data } // namespace Dali -#endif // __DALI_INTERNAL_ECORE_WL_WINDOW_RENDER_SURFACE_H__ +#endif // __DALI_INTERNAL_ECORE_X_WINDOW_RENDER_SURFACE_H__ -- 2.7.4