Blame SOURCES/xdriinfo-1.0.4-glvnd.patch

c33d3f
diff -up xdriinfo-1.0.4/xdriinfo.c~ xdriinfo-1.0.4/xdriinfo.c
c33d3f
--- xdriinfo-1.0.4/xdriinfo.c~	2009-10-16 23:39:10.000000000 +0200
c33d3f
+++ xdriinfo-1.0.4/xdriinfo.c	2017-03-13 12:01:53.419636100 +0100
c33d3f
@@ -101,23 +101,9 @@ int main (int argc, char *argv[]) {
c33d3f
 	    return 1;
c33d3f
 	}
c33d3f
     }
c33d3f
-  /* if the argument to the options command is a driver name, we can handle
c33d3f
-   * it without opening an X connection */
c33d3f
-    if (func == OPTIONS && screenNum == -1) {
c33d3f
-	const char *options = (*GetDriverConfig) (funcArg);
c33d3f
-	if (!options) {
c33d3f
-	    fprintf (stderr,
c33d3f
-		     "Driver \"%s\" is not installed or does not support configuration.\n",
c33d3f
-		     funcArg);
c33d3f
-	    return 1;
c33d3f
-	}
c33d3f
-	printf ("%s", options);
c33d3f
-	if (isatty (STDOUT_FILENO))
c33d3f
-	    printf ("\n");
c33d3f
-	return 0;
c33d3f
-    } 
c33d3f
+
c33d3f
   /* driver command needs a valid screen number */
c33d3f
-    else if (func == DRIVER && screenNum == -1) {
c33d3f
+    if (func == DRIVER && screenNum == -1) {
c33d3f
 	fprintf (stderr, "Invalid screen number \"%s\".\n", funcArg);
c33d3f
 	return 1;
c33d3f
     }
c33d3f
@@ -135,6 +121,9 @@ int main (int argc, char *argv[]) {
c33d3f
 	return 1;
c33d3f
     }
c33d3f
 
c33d3f
+   /* Call glXGetClientString to load vendor libs on glvnd enabled systems */
c33d3f
+    glXGetClientString (dpy, GLX_EXTENSIONS);
c33d3f
+
c33d3f
     switch (func) {
c33d3f
       case NSCREENS:
c33d3f
 	printf ("%d", nScreens);
c33d3f
@@ -154,7 +143,13 @@ int main (int argc, char *argv[]) {
c33d3f
 	  break;
c33d3f
       }
c33d3f
       case OPTIONS: {
c33d3f
-	  const char *name = (*GetScreenDriver) (dpy, screenNum), *options;
c33d3f
+	  const char *name, *options;
c33d3f
+	  
c33d3f
+	  if (screenNum == -1) {
c33d3f
+	      name = funcArg;
c33d3f
+	  } else {
c33d3f
+	      name = (*GetScreenDriver) (dpy, screenNum);
c33d3f
+	  }
c33d3f
 	  if (!name) {
c33d3f
 	      fprintf (stderr, "Screen \"%d\" is not direct rendering capable.\n",
c33d3f
 		       screenNum);