Commit 33dfdfca authored by Lionel Ulmer's avatar Lionel Ulmer Committed by Alexandre Julliard

Test for X11 errors for DGA2 and XVidMode extensions.

parent b6051dec
......@@ -58,9 +58,15 @@ static void convert_mode(XDGAMode *mode, LPDDHALMODEINFO info)
info->dwWidth, info->dwHeight, info->dwBPP, info->wRefreshRate);
}
static int DGA2ErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
{
return 1;
}
void X11DRV_XF86DGA2_Init(void)
{
int nmodes, major, minor, i;
Bool ok;
if (xf86dga2_modes) return; /* already initialized? */
......@@ -71,7 +77,10 @@ void X11DRV_XF86DGA2_Init(void)
if (!TSXDGAQueryExtension(gdi_display, &dga_event, &dga_error)) return;
if (!TSXDGAQueryVersion(gdi_display, &major, &minor)) return;
X11DRV_expect_error(gdi_display, DGA2ErrorHandler, NULL);
ok = TSXDGAQueryVersion(gdi_display, &major, &minor);
if (X11DRV_check_error()) ok = FALSE;
if (!ok) return;
if (major < 2) return; /* only bother with DGA 2+ */
......
......@@ -93,9 +93,15 @@ static void convert_modeline(int dotclock, const XF86VidModeModeLine *mode, LPDD
info->dwAlphaBitMask = 0;
}
static int XVidModeErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
{
return 1;
}
void X11DRV_XF86VM_Init(void)
{
int nmodes, i;
Bool ok;
if (xf86vm_major) return; /* already initialized? */
......@@ -106,7 +112,10 @@ void X11DRV_XF86VM_Init(void)
/* see if XVidMode is available */
if (!TSXF86VidModeQueryExtension(gdi_display, &xf86vm_event, &xf86vm_error)) return;
if (!TSXF86VidModeQueryVersion(gdi_display, &xf86vm_major, &xf86vm_minor)) return;
X11DRV_expect_error(gdi_display, XVidModeErrorHandler, NULL);
ok = TSXF86VidModeQueryVersion(gdi_display, &xf86vm_major, &xf86vm_minor);
if (X11DRV_check_error()) ok = FALSE;
if (!ok) return;
#ifdef X_XF86VidModeSetGammaRamp
if (xf86vm_major > 2 || (xf86vm_major == 2 && xf86vm_minor >= 1))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment