ecore_wl: Handle ECORE_WL_WINDOW_TYPE_NONE correctly
authorEduardo Lima (Etrunko) <eduardo.lima@intel.com>
Wed, 12 Jun 2013 20:15:48 +0000 (17:15 -0300)
committerEduardo Lima (Etrunko) <eduardo.lima@intel.com>
Wed, 12 Jun 2013 20:40:02 +0000 (17:40 -0300)
Also changes the default window type to ECORE_WL_WINDOW_TYPE_TOPLEVEL as it is
the most used case. If someone needs another type, set it manually.

Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com>
src/lib/ecore_wayland/ecore_wl_window.c

index 6dc6ae2..9dca8b8 100644 (file)
@@ -75,8 +75,7 @@ ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buf
    win->allocation.h = h;
    win->saved_allocation = win->allocation;
    win->transparent = EINA_FALSE;
-   /* win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL; */
-   win->type = ECORE_WL_WINDOW_TYPE_NONE;
+   win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
    win->buffer_type = buffer_type;
    win->id = _win_id++;
 
@@ -281,7 +280,8 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
 
    ecore_wl_window_surface_create(win);
 
-   if (win->type != ECORE_WL_WINDOW_TYPE_DND)
+   if (win->type != ECORE_WL_WINDOW_TYPE_DND &&
+       win->type != ECORE_WL_WINDOW_TYPE_NONE)
      {
         if (!win->shell_surface)
           {
@@ -316,9 +316,6 @@ ecore_wl_window_show(Ecore_Wl_Window *win)
                                    win->parent->surface, 
                                    win->allocation.x, win->allocation.y, 0);
         break;
-      case ECORE_WL_WINDOW_TYPE_NONE:
-        win->type = ECORE_WL_WINDOW_TYPE_TOPLEVEL;
-        /* fallthrough */
       case ECORE_WL_WINDOW_TYPE_TOPLEVEL:
         wl_shell_surface_set_toplevel(win->shell_surface);
         break;