diff --git a/src/lib/ecore_wl2/ecore_wl2_private.h b/src/lib/ecore_wl2/ecore_wl2_private.h index 6ec509e9c4..4640d6f41f 100644 --- a/src/lib/ecore_wl2/ecore_wl2_private.h +++ b/src/lib/ecore_wl2/ecore_wl2_private.h @@ -564,6 +564,7 @@ typedef struct _Ecore_Wl2_Surface Eina_Bool alpha : 1; struct { + Eina_Bool (*check)(Ecore_Wl2_Window *win); void (*destroy)(Ecore_Wl2_Surface *surface); void (*reconfigure)(Ecore_Wl2_Surface *surface, int w, int h, uint32_t flags, Eina_Bool force); void *(*data_get)(Ecore_Wl2_Surface *surface, int *w, int *h); diff --git a/src/lib/ecore_wl2/ecore_wl2_surface.c b/src/lib/ecore_wl2/ecore_wl2_surface.c index de10b8ad5f..9ee1df9695 100644 --- a/src/lib/ecore_wl2/ecore_wl2_surface.c +++ b/src/lib/ecore_wl2/ecore_wl2_surface.c @@ -245,18 +245,20 @@ ecore_wl2_surface_create(Ecore_Wl2_Window *win, Eina_Bool alpha) out->w = 0; out->h = 0; - if (!_evas_dmabuf_surface_check(win)) goto err; - + out->funcs.check = _evas_dmabuf_surface_check; out->funcs.destroy = _evas_dmabuf_surface_destroy; out->funcs.reconfigure = _evas_dmabuf_surface_reconfigure; out->funcs.data_get = _evas_dmabuf_surface_data_get; out->funcs.assign = _evas_dmabuf_surface_assign; out->funcs.post = _evas_dmabuf_surface_post; out->funcs.flush = _surface_flush; - win->wl2_surface = out; - return out; -err: + if (out->funcs.check(win)) + { + win->wl2_surface = out; + return out; + } + free(out); return NULL; }