X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/421d68352da46872c590a48e0ce601946813995a..ecc0ba5b2e559a13cae7d4b515841ffe24624bbb:/settings.c diff --git a/settings.c b/settings.c index 0c642f50..6f488d82 100644 --- a/settings.c +++ b/settings.c @@ -598,8 +598,17 @@ void load_open_settings(void *sesskey, int do_host, Config *cfg) gppi(sesskey, "BCE", 1, &cfg->bce); gppi(sesskey, "BlinkText", 0, &cfg->blinktext); gppi(sesskey, "X11Forward", 0, &cfg->x11_forward); +#ifdef _WINDOWS gpps(sesskey, "X11Display", "localhost:0", cfg->x11_display, sizeof(cfg->x11_display)); +#else + { + /* On Unix, the default X display should simply be $DISPLAY. */ + char *disp = getenv("DISPLAY"); + gpps(sesskey, "X11Display", disp, cfg->x11_display, + sizeof(cfg->x11_display)); + } +#endif gppi(sesskey, "LocalPortAcceptAll", 0, &cfg->lport_acceptall); gppi(sesskey, "RemotePortAcceptAll", 0, &cfg->rport_acceptall);