kopia lustrzana https://github.com/FreeSpacenav/spacenavd
- 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-baaf7b16a646pull/1/head
rodzic
a0fe5c1101
commit
dcaac5cd37
15
spnavd.c
15
spnavd.c
|
|
@ -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);
|
||||
|
|
|
|||
Ładowanie…
Reference in New Issue