XQuartz: Force X11Controller to reset a broken DISPLAY envvar.

(cherry picked from commit f1a52b5b5ac31702497937efe3ac578be9a6c54f)
This commit is contained in:
Jeremy Huddleston 2008-11-25 01:30:03 -08:00
commit 94df1ab7f0
3 changed files with 20 additions and 3 deletions

View file

@ -57,6 +57,8 @@ void DarwinListenOnOpenFD(int fd);
extern int noPanoramiXExtension;
extern int xquartz_resetenv_display;
#define DEFAULT_CLIENT "/usr/X11/bin/xterm"
#define DEFAULT_STARTX "/usr/X11/bin/startx"
#define DEFAULT_SHELL "/bin/sh"
@ -408,6 +410,9 @@ int startup_trigger(int argc, char **argv, char **envp) {
if((s = getenv("DISPLAY"))) {
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY=\"%s\", unsetting). Starting X server.\n", s);
unsetenv("DISPLAY");
/* This tells X11Controller to not use the environment's DISPLAY and reset it based on the server's display */
xquartz_resetenv_display = 1;
} else {
fprintf(stderr, "X11.app: Could not connect to server (DISPLAY is not set). Starting X server.\n");
}