diff options
author | Matthieu Herrb <matthieu@herrb.eu> | 2017-10-22 18:37:36 +0200 |
---|---|---|
committer | Matthieu Herrb <matthieu@herrb.eu> | 2017-10-22 18:37:36 +0200 |
commit | ab775cddbfedfd98cd24a95180a823df5a47ff07 (patch) | |
tree | 1a189f1b625651703e758c0fdca7a66ca9669597 | |
parent | 43c51ffbc0831c8bad21f3aa3ba613bf1a72f79c (diff) | |
parent | 6273d9dacbf165331c21bcda5a8945c8931d87b8 (diff) |
Merge remote-tracking branch 'origin/master' into obsd
-rw-r--r-- | xdriinfo.c | 29 |
1 files changed, 12 insertions, 17 deletions
@@ -112,23 +112,9 @@ int main (int argc, char *argv[]) { return 1; } } - /* if the argument to the options command is a driver name, we can handle - * it without opening an X connection */ - if (func == OPTIONS && screenNum == -1) { - const char *options = (*GetDriverConfig) (funcArg); - if (!options) { - fprintf (stderr, - "Driver \"%s\" is not installed or does not support configuration.\n", - funcArg); - return 1; - } - printf ("%s", options); - if (isatty (STDOUT_FILENO)) - printf ("\n"); - return 0; - } + /* driver command needs a valid screen number */ - else if (func == DRIVER && screenNum == -1) { + if (func == DRIVER && screenNum == -1) { fprintf (stderr, "Invalid screen number \"%s\".\n", funcArg); return 1; } @@ -146,6 +132,9 @@ int main (int argc, char *argv[]) { return 1; } + /* Call glXGetClientString to load vendor libs on glvnd enabled systems */ + glXGetClientString (dpy, GLX_EXTENSIONS); + switch (func) { case NSCREENS: printf ("%d", nScreens); @@ -165,7 +154,13 @@ int main (int argc, char *argv[]) { break; } case OPTIONS: { - const char *name = (*GetScreenDriver) (dpy, screenNum), *options; + const char *name, *options; + + if (screenNum == -1) { + name = funcArg; + } else { + name = (*GetScreenDriver) (dpy, screenNum); + } if (!name) { fprintf (stderr, "Screen \"%d\" is not direct rendering capable.\n", screenNum); |