wayland: Try not to draw into surfaces without roles
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 19 Jan 2017 21:25:17 +0000 (15:25 -0600)
committerDerek Foreman <derekf@osg.samsung.com>
Thu, 19 Jan 2017 21:25:17 +0000 (15:25 -0600)
xdg v6 will barf if we attach a buffer to the surface before
we receive a configure - even if we attach before trying to
make a shell surface.

So we need to prevent any drawing into surfaces until we've
decided what kind of surface they'll ultimately be.

Fix T5090

src/lib/ecore_wl2/ecore_wl2_display.c
src/lib/ecore_wl2/ecore_wl2_window.c

index 99e7334..c2fc38d 100644 (file)
@@ -176,6 +176,8 @@ _cb_global_add(void *data, struct wl_registry *registry, unsigned int id, const
           if ((window->type != ECORE_WL2_WINDOW_TYPE_DND) &&
               (window->type != ECORE_WL2_WINDOW_TYPE_NONE))
                 _ecore_wl2_window_shell_surface_init(window);
+          else
+            window->pending.configure = EINA_FALSE;
      }
    else if (!strcmp(interface, "zxdg_shell_v6"))
      {
index 327185c..8acb7d5 100644 (file)
@@ -512,6 +512,7 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
                                  &_xdg_surface_listener, window);
 
         window->configure_ack = xdg_surface_ack_configure;
+        window->pending.configure = EINA_FALSE;
         _ecore_wl2_window_type_set(window);
      }
    else if ((window->display->wl.wl_shell) && (!window->wl_shell_surface))
@@ -528,6 +529,7 @@ _ecore_wl2_window_shell_surface_init(Ecore_Wl2_Window *window)
 
         wl_shell_surface_add_listener(window->wl_shell_surface,
                                       &_wl_shell_surface_listener, window);
+        window->pending.configure = EINA_FALSE;
         _ecore_wl2_window_type_set(window);
      }
 
@@ -615,6 +617,8 @@ ecore_wl2_window_new(Ecore_Wl2_Display *display, Ecore_Wl2_Window *parent, int x
 
    win->type = ECORE_WL2_WINDOW_TYPE_TOPLEVEL;
 
+   win->pending.configure = EINA_TRUE;
+
    display->windows =
      eina_inlist_append(display->windows, EINA_INLIST_GET(win));
 
@@ -668,6 +672,8 @@ ecore_wl2_window_show(Ecore_Wl2_Window *window)
         _ecore_wl2_window_shell_surface_init(window);
         _ecore_wl2_window_www_surface_init(window);
      }
+   else
+     window->pending.configure = EINA_FALSE;
 }
 
 EAPI void