From 08e2985e57436e585a3854ae02ec1584aeb5fe3e Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 19 Jul 2024 08:57:12 -0400 Subject: [PATCH] glx: move driwindows_display::event_base to driwindows_context Reviewed-by: Adam Jackson Part-of: --- src/glx/driwindows_glx.c | 41 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/src/glx/driwindows_glx.c b/src/glx/driwindows_glx.c index 2f3fc49023b..57d8382cc54 100644 --- a/src/glx/driwindows_glx.c +++ b/src/glx/driwindows_glx.c @@ -30,7 +30,6 @@ struct driwindows_display { - int event_base; }; struct driwindows_context @@ -50,6 +49,7 @@ struct driwindows_screen struct glx_screen base; __DRIscreen *driScreen; __GLXDRIscreen vtable; + int event_base; Bool copySubBuffer; }; @@ -466,6 +466,24 @@ driwindowsCreateScreen(int screen, struct glx_display *priv, bool driver_name_is struct driwindows_screen *psc; struct glx_config *configs = NULL, *visuals = NULL; int directCapable; + int eventBase, errorBase; + int major, minor, patch; + + /* Verify server has Windows-DRI extension */ + if (!XWindowsDRIQueryExtension(dpy, &eventBase, &errorBase)) { + ErrorMessageF("Windows-DRI extension not available\n"); + return NULL; + } + + if (!XWindowsDRIQueryVersion(dpy, &major, &minor, &patch)) { + ErrorMessageF("Fetching Windows-DRI extension version failed\n"); + return NULL; + } + + if (!windows_check_renderer()) { + ErrorMessageF("Windows-DRI extension disabled for GDI Generic renderer\n"); + return NULL; + } psc = calloc(1, sizeof *psc); if (psc == NULL) @@ -537,30 +555,9 @@ driwindowsCreateDisplay(Display * dpy) { struct driwindows_display *pdpyp; - int eventBase, errorBase; - int major, minor, patch; - - /* Verify server has Windows-DRI extension */ - if (!XWindowsDRIQueryExtension(dpy, &eventBase, &errorBase)) { - ErrorMessageF("Windows-DRI extension not available\n"); - return NULL; - } - - if (!XWindowsDRIQueryVersion(dpy, &major, &minor, &patch)) { - ErrorMessageF("Fetching Windows-DRI extension version failed\n"); - return NULL; - } - - if (!windows_check_renderer()) { - ErrorMessageF("Windows-DRI extension disabled for GDI Generic renderer\n"); - return NULL; - } - pdpyp = malloc(sizeof *pdpyp); if (pdpyp == NULL) return NULL; - pdpyp->event_base = eventBase; - return &pdpyp->base; }