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:
18
x11fwd.c
18
x11fwd.c
@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user