From 5d1d2ca32513a04f01e5f4cf938f6aa5ae513fcc Mon Sep 17 00:00:00 2001 From: Manuel Bachmann Date: Sun, 29 Mar 2015 08:17:01 +0200 Subject: [PATCH] toytoolkit: fix EGL surface creation for lazy drivers Some DRI drivers, including VMware vmwgfx, do not support calling eglQueryString() with a EGL_NO_DISPLAY parameter. Allow toytoolkit to create EGL surfaces with them, by falling back to the old creation method. Signed-off-by: Manuel Bachmann Reviewed-by: Pekka Paalanen --- shared/platform.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/shared/platform.h b/shared/platform.h index ff640b54..364ce5aa 100644 --- a/shared/platform.h +++ b/shared/platform.h @@ -55,8 +55,9 @@ weston_platform_get_egl_proc_address(const char *address) { const char *extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); - if (strstr(extensions, "EGL_EXT_platform_wayland") - || strstr(extensions, "EGL_KHR_platform_wayland")) { + if (extensions + && (strstr(extensions, "EGL_EXT_platform_wayland") + || strstr(extensions, "EGL_KHR_platform_wayland"))) { return (void *) eglGetProcAddress(address); }