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