Просмотр исходного кода

x11: Explicitly specify EGL platform

Mesa's eglGetDisplay() chooses the native EGL platform from
EGL_PLATFORM, limited autodetection, or the build-time default. If that
selects Wayland while SDL is using the X11 video backend, Mesa can treat
the X11 Display pointer as a wl_display and crash during
eglInitialize().

See: https://gitlab.com/qemu-project/qemu/-/work_items/3540
Akihiko Odaki 1 неделя назад
Родитель
Сommit
b3aa7083e2
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      src/video/x11/SDL_x11opengles.c

+ 2 - 1
src/video/x11/SDL_x11opengles.c

@@ -53,7 +53,8 @@ int X11_GLES_LoadLibrary(_THIS, const char *path)
 #endif
 #endif
     }
     }
 
 
-    return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display, 0);
+    return SDL_EGL_LoadLibrary(_this, path, (NativeDisplayType) data->display,
+                               EGL_PLATFORM_X11_KHR);
 }
 }
 
 
 XVisualInfo *X11_GLES_GetVisual(_THIS, Display *display, int screen)
 XVisualInfo *X11_GLES_GetVisual(_THIS, Display *display, int screen)