From c2bc012d48c4de6a0fac8cdb5ca8bb25822a494d Mon Sep 17 00:00:00 2001 From: Mark Penner Date: Fri, 14 Feb 2025 18:51:34 -0600 Subject: [PATCH] egl-helpers.h: do not depend on X11 Window type, use EGLNativeWindowType It was assumed that mesa provides the necessary X11 includes, but it is not always the case, as it can be configured without x11 support. See: [1]: https://gitlab.com/qemu-project/qemu/-/commit/fbd57c754f32804a63295f70f271d1ef128ee590 Signed-off-by: Mark Penner --- include/ui/egl-helpers.h | 2 +- ui/egl-helpers.c | 4 ++-- ui/gtk-egl.c | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/include/ui/egl-helpers.h b/include/ui/egl-helpers.h index 5ad5dc30816..fed0deb1a8e 100644 --- a/include/ui/egl-helpers.h +++ b/include/ui/egl-helpers.h @@ -7,7 +7,7 @@ extern EGLDisplay *qemu_egl_display; extern EGLConfig qemu_egl_config; -EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win); +EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win); int qemu_egl_init_dpy(EGLNativeDisplayType dpy, bool gles, bool debug); EGLContext qemu_egl_init_ctx(void); diff --git a/ui/egl-helpers.c b/ui/egl-helpers.c index 87d77afaa85..1691f7776e8 100644 --- a/ui/egl-helpers.c +++ b/ui/egl-helpers.c @@ -27,7 +27,7 @@ static int egl_debug; /* ---------------------------------------------------------------------- */ -EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win) +EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, EGLNativeWindowType win) { EGLSurface esurface; EGLBoolean b; @@ -36,7 +36,7 @@ EGLSurface qemu_egl_init_surface_x11(EGLContext ectx, Window win) (unsigned long) win); esurface = eglCreateWindowSurface(qemu_egl_display, qemu_egl_config, - (EGLNativeWindowType)win, NULL); + win, NULL); if (esurface == EGL_NO_SURFACE) { fprintf(stderr, "egl: eglCreateWindowSurface failed\n"); return NULL; diff --git a/ui/gtk-egl.c b/ui/gtk-egl.c index 500c42c9fac..0d3ae039687 100644 --- a/ui/gtk-egl.c +++ b/ui/gtk-egl.c @@ -63,7 +63,8 @@ void gd_egl_init(VirtualConsole *vc) } vc->gfx.ectx = qemu_egl_init_ctx(); - vc->gfx.esurface = qemu_egl_init_surface_x11(vc->gfx.ectx, x11_window); + vc->gfx.esurface = qemu_egl_init_surface_x11 + (vc->gfx.ectx, (EGLNativeWindowType)x11_window); assert(vc->gfx.esurface); }