1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-06-30 11:02:48 -05:00

X forwarding changes:

- new function platform_get_x_display() to find a sensible local display.
   On Unix, the Gtk apps weren't taking account of --display when
   determining where to send forwarded X traffic.
 - explicitly document that leaving X display location blank in config tries
   to do something sensible (and that it's now blank by default)
 - don't override X11Display setting in plink, since that's more properly
   done later

[originally from svn r4604]
This commit is contained in:
Jacob Nevins
2004-10-06 22:31:07 +00:00
parent e375ba107d
commit 98028c746f
10 changed files with 61 additions and 22 deletions

View File

@ -119,5 +119,3 @@ void platform_get_x11_auth(char *display, int *protocol,
pclose(fp);
sfree(localbuf);
}
const char platform_x11_best_transport[] = "unix";

View File

@ -318,3 +318,13 @@ int is_interactive(void)
{
return isatty(0);
}
/*
* X11-forwarding-related things suitable for console.
*/
const char platform_x11_best_transport[] = "unix";
char *platform_get_x_display(void) {
return dupstr(getenv("DISPLAY"));
}

View File

@ -73,8 +73,6 @@ static Config cfg;
*/
char *platform_default_s(const char *name)
{
if (!strcmp(name, "X11Display"))
return dupstr(getenv("DISPLAY"));
if (!strcmp(name, "TermType"))
return dupstr(getenv("TERM"));
if (!strcmp(name, "UserName"))

View File

@ -7,6 +7,7 @@
#include <stdlib.h>
#include <assert.h>
#include <unistd.h>
#include <gdk/gdk.h>
#include "putty.h"
#include "storage.h"
@ -105,6 +106,21 @@ char *make_default_wintitle(char *hostname)
return dupcat(hostname, " - PuTTY", NULL);
}
/*
* X11-forwarding-related things suitable for Gtk app.
*/
const char platform_x11_best_transport[] = "unix";
char *platform_get_x_display(void) {
const char *display;
/* Try to take account of --display and what have you. */
if (!(display = gdk_get_display()))
/* fall back to traditional method */
display = getenv("DISPLAY");
return dupstr(display);
}
int main(int argc, char **argv)
{
extern int pt_main(int argc, char **argv);

View File

@ -34,8 +34,6 @@ void platform_get_x11_auth(char *display, int *protocol,
/* Do nothing, therefore no auth. */
}
const char platform_x11_best_transport[] = "unix";
/*
* Default settings that are specific to PSFTP.
*/