- Now taking heed of the DISPLAY variable if it's set.

git-svn-id: svn+ssh://svn.code.sf.net/p/spacenav/code/spacenavd@19 ef983eb1-d774-4af8-acfd-baaf7b16a646
pull/1/head
John Tsiombikas 2008-04-05 03:48:37 +00:00
rodzic a0fe5c1101
commit dcaac5cd37
1 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -609,8 +609,19 @@ int init_x11(void)
if(dpy) return 0;
if(!(dpy = XOpenDisplay(":0"))) {
fprintf(stderr, "failed to open X11 display: \":0\"\n");
/* if the server started from init, it probably won't have a DISPLAY env var
* so we go on and add a default one.
*/
if(!getenv("DISPLAY")) {
putenv("DISPLAY=:0.0");
}
if(verbose) {
printf("trying to open X11 display \"%s\"\n", getenv("DISPLAY"));
}
if(!(dpy = XOpenDisplay(0))) {
fprintf(stderr, "failed to open X11 display \"%s\"\n", getenv("DISPLAY"));
return -1;
}
scr_count = ScreenCount(dpy);