ecore-wayland: Cleanup shell surface creation
authorChris Michael <cp.michael@samsung.com>
Tue, 2 Sep 2014 13:14:36 +0000 (09:14 -0400)
committerChris Michael <cp.michael@samsung.com>
Wed, 1 Oct 2014 20:15:37 +0000 (16:15 -0400)
Summary:
  We had some duplication happening here when the IVI shell code got
added. This cleans up the surface creation code (parts of it were
being duplicated)

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/lib/ecore_wayland/ecore_wl_window.c

index 75fcd7d..23f0b9d 100644 (file)
@@ -304,17 +304,16 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
         if (!win->ivi_surface) 
           {
 #endif
-             if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell))
-               if ((!win->xdg_surface) && (_ecore_wl_disp->wl.xdg_shell))
-                 {
-                    win->xdg_surface =
-                      xdg_shell_get_xdg_surface(_ecore_wl_disp->wl.xdg_shell,
-                                                win->surface);
-                    if (!win->xdg_surface) return;
-                    xdg_surface_set_user_data(win->xdg_surface, win);
-                    xdg_surface_add_listener(win->xdg_surface,
-                                             &_ecore_xdg_surface_listener, win);
-                 }
+             if ((!win->xdg_surface) && (_ecore_wl_disp->wl.xdg_shell))
+               {
+                  win->xdg_surface =
+                    xdg_shell_get_xdg_surface(_ecore_wl_disp->wl.xdg_shell,
+                                              win->surface);
+                  if (!win->xdg_surface) return;
+                  xdg_surface_set_user_data(win->xdg_surface, win);
+                  xdg_surface_add_listener(win->xdg_surface,
+                                           &_ecore_xdg_surface_listener, win);
+               }
              else if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell))
                {
                   win->shell_surface = 
@@ -335,31 +334,6 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
 #ifdef USE_IVI_SHELL
           }
 #endif
-             win->xdg_surface =
-               xdg_shell_get_xdg_surface(_ecore_wl_disp->wl.xdg_shell,
-                                         win->surface);
-             if (!win->xdg_surface) return;
-             xdg_surface_set_user_data(win->xdg_surface, win);
-             xdg_surface_add_listener(win->xdg_surface,
-                                      &_ecore_xdg_surface_listener, win);
-          }
-        else if ((!win->shell_surface) && (_ecore_wl_disp->wl.shell))
-          {
-             win->shell_surface = 
-               wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell,
-                                          win->surface);
-             if (!win->shell_surface) return;
-
-             wl_shell_surface_add_listener(win->shell_surface,
-                                           &_ecore_wl_shell_surface_listener,
-                                           win);
-
-             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);
-           }
      }
 
    /* trap for valid shell surface */