1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-01 11:32:48 -05:00

Propagate the screen number from a local X display to the remote

forwarded one. Fixes `x11-default-screen'.

[originally from svn r2418]
This commit is contained in:
Simon Tatham
2003-01-02 10:41:22 +00:00
parent 2435c54597
commit 368ead15bc
2 changed files with 22 additions and 2 deletions

View File

@ -139,6 +139,24 @@ static void x11_sent(Plug plug, int bufsize)
sshfwd_unthrottle(pr->c, bufsize);
}
/*
* When setting up X forwarding, we should send the screen number
* from the specified local display. This function extracts it from
* the display string.
*/
int x11_get_screen_number(char *display)
{
int n;
n = strcspn(display, ":");
if (!display[n])
return 0;
n = strcspn(display, ".");
if (!display[n])
return 0;
return atoi(display + n + 1);
}
/*
* Called to set up the raw connection.
*