代码拉取完成,页面将自动刷新
diff -up xdriinfo-1.0.4/xdriinfo.c~ xdriinfo-1.0.4/xdriinfo.c
--- xdriinfo-1.0.4/xdriinfo.c~ 2009-10-16 23:39:10.000000000 +0200
+++ xdriinfo-1.0.4/xdriinfo.c 2017-03-13 12:01:53.419636100 +0100
@@ -101,23 +101,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;
}
@@ -135,6 +121,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);
@@ -154,7 +143,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);
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。