[Tizen] Support Ecore-Wayland2
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / tizen / adaptor-impl-tizen.cpp
index 1dfd267..e9c44e4 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <app_common.h>
+#include <system_settings.h>
+
 #ifdef APPCORE_WATCH_AVAILABLE
 #include <screen_connector_provider.h>
-#include <dali/integration-api/wayland/ecore-wl-render-surface.h>
 #endif
 
-#include <system_settings.h>
+#ifdef ECORE_WAYLAND2
+#include <Ecore_Wl2.h>
+#else
+#include <Ecore_Wayland.h>
+#endif
+
 
 namespace Dali
 {
@@ -101,16 +107,19 @@ void Adaptor::SurfaceInitialized()
     return;
   }
   char *appId;
-  char *id;
-  app_get_id(&id);
+  app_get_id(&appId);
 
   // Use strdup() in app_get_id(), so need to free memory
-  if( id )
+  if( appId )
   {
-    appId = id;
+#ifdef ECORE_WAYLAND2
+    Ecore_Wl2_Window* ecoreWlWindow = AnyCast<Ecore_Wl2_Window*>( mNativeWindow );
+    screen_connector_provider_remote_enable( appId, ecore_wl2_window_surface_get( ecoreWlWindow ) );
+#else
     Ecore_Wl_Window* ecoreWlWindow = AnyCast<Ecore_Wl_Window*>( mNativeWindow );
-    screen_connector_provider_remote_enable(appId, ecore_wl_window_surface_get(ecoreWlWindow));
-    free( id );
+    screen_connector_provider_remote_enable( appId, ecore_wl_window_surface_get( ecoreWlWindow ) );
+#endif
+    free( appId );
   }
 #endif
 }