EGLDisplay bionic_eglGetDisplay(NativeDisplayType native_display) { /* * On android, at least SDL passes 0 (EGL_DISPLAY_DEFAULT) to eglGetDisplay and uses the resulting display. * We obviously want to make the app use the correct display, which may happen to be a different one * than the "default" display (especially on Wayland) */ GdkDisplay *display = gtk_root_get_display(GTK_ROOT(window)); struct wl_display *wl_display = gdk_wayland_display_get_wl_display(display); return eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, wl_display, NULL); }