You've already forked android_translation_layer
mirror of
https://gitlab.com/android_translation_layer/android_translation_layer.git
synced 2025-10-27 11:48:10 -07:00
api-impl-jni: SurfaceView: silence deprecation warnings concerning GDK's x11 backend
This commit is contained in:
@@ -355,6 +355,11 @@ ANativeWindow * ANativeWindow_fromSurface(JNIEnv* env, jobject surface)
|
||||
native_window->wayland_surface = wayland_surface;
|
||||
printf("EGL::: wayland_surface: %p\n", wayland_surface);
|
||||
} else if (GDK_IS_X11_DISPLAY (display)) {
|
||||
/* X11 support is deprecated, which means that if we decide to switch to Gtk 5 we will loose the ability to run ATL on X11.
|
||||
* for now, silence the warnings */
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
|
||||
int major;
|
||||
int minor;
|
||||
|
||||
@@ -400,6 +405,8 @@ ANativeWindow * ANativeWindow_fromSurface(JNIEnv* env, jobject surface)
|
||||
XDestroyRegion(region);
|
||||
|
||||
native_window->egl_window = (EGLNativeWindowType)x11_window;
|
||||
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
native_window->resize_handler = g_signal_connect(surface_view_widget, "resize", G_CALLBACK(on_resize), native_window);
|
||||
@@ -507,7 +514,10 @@ EGLDisplay bionic_eglGetDisplay(EGLNativeDisplayType native_display)
|
||||
struct wl_display *wl_display = gdk_wayland_display_get_wl_display(display);
|
||||
return eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, wl_display, NULL);
|
||||
} else if (GDK_IS_X11_DISPLAY (display)) {
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
Display *x11_display = gdk_x11_display_get_xdisplay(display);
|
||||
#pragma GCC diagnostic pop
|
||||
return eglGetPlatformDisplay(EGL_PLATFORM_X11_KHR, x11_display, NULL);
|
||||
} else {
|
||||
return NULL;
|
||||
|
||||
@@ -269,7 +269,10 @@ struct wl_display *wayland_server_start()
|
||||
struct wl_display *wl_display = gdk_wayland_display_get_wl_display(gdk_display);
|
||||
egl_display_gtk = eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_KHR, wl_display, NULL);
|
||||
} else if (GDK_IS_X11_DISPLAY(gdk_display)) {
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
|
||||
Display *x11_display = gdk_x11_display_get_xdisplay(gdk_display);
|
||||
#pragma GCC diagnostic pop
|
||||
egl_display_gtk = eglGetPlatformDisplay(EGL_PLATFORM_X11_KHR, x11_display, NULL);
|
||||
}
|
||||
gl_context_gtk = gdk_surface_create_gl_context(gtk_native_get_surface(GTK_NATIVE(window)), NULL);
|
||||
|
||||
Reference in New Issue
Block a user