[3.0] Implemented Window::SetClass() functionality in window-impl-ecore-wl.cpp 35/98835/1
authorsuhyung Eom <suhyung.eom@samsung.com>
Mon, 21 Nov 2016 04:06:22 +0000 (13:06 +0900)
committersuhyung Eom <suhyung.eom@samsung.com>
Mon, 21 Nov 2016 04:09:42 +0000 (13:09 +0900)
Signed-off-by: suhyung Eom <suhyung.eom@samsung.com>
Change-Id: I6642bafffea6020b5a9aedd91190dfd6438497d4

adaptors/ecore/wayland/window-impl-ecore-wl.cpp

index 5849317..184299c 100644 (file)
@@ -244,6 +244,18 @@ void Window::SetIndicatorBgOpacity( Dali::Window::IndicatorBgOpacity opacityMode
 
 void Window::SetClass(std::string name, std::string klass)
 {
+  ECore::WindowRenderSurface* wlSurface( dynamic_cast< ECore::WindowRenderSurface * >( mSurface ) );
+
+  if( wlSurface )
+  {
+    Ecore_Wl_Window* wlWindow = wlSurface->GetWlWindow();
+    ecore_wl_window_title_set( wlWindow, name.c_str() );
+    ecore_wl_window_class_name_set( wlWindow, klass.c_str() );
+  }
+  else
+  {
+    DALI_LOG_INFO( gWindowLogFilter, Debug::General, "Window has no surface\n" );
+  }
 }
 
 Window::Window()
@@ -291,15 +303,10 @@ void Window::Initialize(const PositionSize& windowPosition, const std::string& n
   // create an Wayland window by default
   Any surface;
   ECore::WindowRenderSurface* windowSurface = new ECore::WindowRenderSurface( windowPosition, surface, name, mIsTransparent );
-  SetClass( name, className );
-  windowSurface->Map();
 
   mSurface = windowSurface;
-
-  std::string appId;
-  mAdaptor->GetAppId( appId );
-  Ecore_Wl_Window* wlWindow = windowSurface ->GetWlWindow();
-  ecore_wl_window_class_name_set(wlWindow, appId.c_str());
+  SetClass( name, className );
+  windowSurface->Map();
 
   mOrientation = Orientation::New(this);