ecore_wl: fix the issue that couldn't initialize the tizen policy. 29/51729/2
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 13 Nov 2015 06:43:29 +0000 (15:43 +0900)
committerGwanglim Lee <gl77.lee@samsung.com>
Fri, 13 Nov 2015 08:27:34 +0000 (17:27 +0900)
even if window type is NONE, we should initialize the tizen policy on
wayland.

Change-Id: I6b6abedfed37b43ee44f85e7acd5e4a8f091b177

src/lib/ecore_wayland/ecore_wl_window.c

index 873f707..96fc769 100644 (file)
@@ -103,62 +103,64 @@ _ecore_wl_window_shell_surface_init(Ecore_Wl_Window *win)
    char *env;
 #endif
 
-   if ((win->type == ECORE_WL_WINDOW_TYPE_DND) ||
-       (win->type == ECORE_WL_WINDOW_TYPE_NONE)) return;
-#ifdef USE_IVI_SHELL
-   if ((!win->ivi_surface) && (_ecore_wl_disp->wl.ivi_application))
-     {
-        if (win->parent && win->parent->ivi_surface)
-          win->ivi_surface_id = win->parent->ivi_surface_id + 1;
-        else if ((env = getenv("ECORE_IVI_SURFACE_ID")))
-          win->ivi_surface_id = atoi(env);
-        else
-          win->ivi_surface_id = IVI_SURFACE_ID + getpid();
-
-        win->ivi_surface =
-          ivi_application_surface_create(_ecore_wl_disp->wl.ivi_application,
-                                         win->ivi_surface_id, win->surface);
-     }
-
-   if (!win->ivi_surface)
+   if ((win->type != ECORE_WL_WINDOW_TYPE_DND) &&
+       (win->type != ECORE_WL_WINDOW_TYPE_NONE))
      {
-#endif
-        if (_ecore_wl_disp->wl.xdg_shell)
+#ifdef USE_IVI_SHELL
+        if ((!win->ivi_surface) && (_ecore_wl_disp->wl.ivi_application))
           {
-             if (win->xdg_surface) return;
-             win->xdg_surface =
-               xdg_shell_get_xdg_surface(_ecore_wl_disp->wl.xdg_shell,
-                                         win->surface);
-             if (!win->xdg_surface) return;
-             if (win->title)
-               xdg_surface_set_title(win->xdg_surface, win->title);
-             if (win->class_name)
-               xdg_surface_set_app_id(win->xdg_surface, win->class_name);
-             xdg_surface_set_user_data(win->xdg_surface, win);
-             xdg_surface_add_listener(win->xdg_surface,
-                                      &_ecore_xdg_surface_listener, win);
+             if (win->parent && win->parent->ivi_surface)
+               win->ivi_surface_id = win->parent->ivi_surface_id + 1;
+             else if ((env = getenv("ECORE_IVI_SURFACE_ID")))
+               win->ivi_surface_id = atoi(env);
+             else
+               win->ivi_surface_id = IVI_SURFACE_ID + getpid();
+
+             win->ivi_surface =
+                ivi_application_surface_create(_ecore_wl_disp->wl.ivi_application,
+                                               win->ivi_surface_id, win->surface);
           }
-        else if (_ecore_wl_disp->wl.shell)
+
+        if (!win->ivi_surface)
           {
-             if (win->shell_surface) return;
-             win->shell_surface =
-               wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell,
-                                          win->surface);
-             if (!win->shell_surface) return;
+#endif
+             if (_ecore_wl_disp->wl.xdg_shell)
+               {
+                  if (win->xdg_surface) return;
+                  win->xdg_surface =
+                     xdg_shell_get_xdg_surface(_ecore_wl_disp->wl.xdg_shell,
+                                               win->surface);
+                  if (!win->xdg_surface) return;
+                  if (win->title)
+                    xdg_surface_set_title(win->xdg_surface, win->title);
+                  if (win->class_name)
+                    xdg_surface_set_app_id(win->xdg_surface, win->class_name);
+                  xdg_surface_set_user_data(win->xdg_surface, win);
+                  xdg_surface_add_listener(win->xdg_surface,
+                                           &_ecore_xdg_surface_listener, win);
+               }
+             else if (_ecore_wl_disp->wl.shell)
+               {
+                  if (win->shell_surface) return;
+                  win->shell_surface =
+                     wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell,
+                                                win->surface);
+                  if (!win->shell_surface) return;
 
-             if (win->title)
-               wl_shell_surface_set_title(win->shell_surface, win->title);
+                  if (win->title)
+                    wl_shell_surface_set_title(win->shell_surface, win->title);
 
-             if (win->class_name)
-               wl_shell_surface_set_class(win->shell_surface, win->class_name);
-          }
+                  if (win->class_name)
+                    wl_shell_surface_set_class(win->shell_surface, win->class_name);
+               }
 
-        if (win->shell_surface)
-          wl_shell_surface_add_listener(win->shell_surface,
-                                        &_ecore_wl_shell_surface_listener, win);
+             if (win->shell_surface)
+               wl_shell_surface_add_listener(win->shell_surface,
+                                             &_ecore_wl_shell_surface_listener, win);
 #ifdef USE_IVI_SHELL
-     }
+          }
 #endif
+     }
 
    if (_ecore_wl_disp->wl.tz_policy)
      {