avoid XF86DGANoDirectVideoMode while detecting no dga

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I did not investigate root causes, so someone may know
a better fix.

LICENSE: X11
CHANGELOG: 
* dlls/x11drv/dga2.c: Greg Turner <gmturner@ameritech.net>
- avoid X11 error during DGA detection.

-- 
gmt

"Oh, and of course, the fastest way to dig
 a tunnel is to dig at both sides."
   -- The Linux Advanced Routing HOWTO

Index: dlls/x11drv/dga2.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/dga2.c,v
retrieving revision 1.12
diff -u -r1.12 dga2.c
--- dlls/x11drv/dga2.c  24 Sep 2002 18:36:51 -0000      1.12
+++ dlls/x11drv/dga2.c  24 Oct 2002 21:13:33 -0000
@@ -69,6 +69,8 @@
   int nmodes, major, minor, i;
   Bool ok;
 
+  TRACE("\n");
+
   if (xf86dga2_modes) return; /* already initialized? */
 
   /* if in desktop mode, don't use DGA */
@@ -91,14 +93,23 @@
 
   /* test that it works */
   wine_tsx11_lock();
+  X11DRV_expect_error(gdi_display, DGA2ErrorHandler, NULL);
   if ((ok = XDGAOpenFramebuffer(gdi_display, DefaultScreen(gdi_display))))
   {
-      XDGACloseFramebuffer(gdi_display, DefaultScreen(gdi_display));
-      /* retrieve modes */
-      modes = XDGAQueryModes(gdi_display, DefaultScreen(gdi_display), &nmodes);
-      if (!modes) ok = FALSE;
+      if (X11DRV_check_error()) {
+          WARN("disabling XF86DGA2 (insufficient permissions?)\n");
+          ok = FALSE;
+      } else {
+          XDGACloseFramebuffer(gdi_display, DefaultScreen(gdi_display));
+          /* retrieve modes */
+          modes = XDGAQueryModes(gdi_display, DefaultScreen(gdi_display), &nmodes);
+          if (!modes) ok = FALSE;
+      }
+  } else { 
+      X11DRV_check_error();
+      WARN("disabling XF86DGA2 (insufficient permissions?)\n");
   }
-  else WARN("disabling XF86DGA2 (insufficient permissions?)\n");
+
   wine_tsx11_unlock();
   if (!ok) return;
 



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux