Hi. I've been playing with Xrdp and x11vnc - and specifically with the
client window size. I think the following patch should add rough
support for the DesktopSize pseudoencoding, which allows a VNC server
to tell the client (in this case the Xrdp server) that its geometry
has changed. I've only looked at the Xrdp code for less than an hour,
so I might well be doing something wrong here - but at least it seems
to work.
On the VNC protocol side, the new geometry is sent encoded as a
rectangle; I've perhaps optimistically assumed that it will always be
(0,0)-(newWidth,newHeight).
What I've tested:
Windows 7 remote desktop client, connected to Xrdp. In Xrdp, connect
to x11vnc (set to create an xdummy server, since xdummy supports
xrandr). When logged on, use xrandr to change resolution - and the
client window should change to the given size as well.
Patch against 0.5.0 follows:
###
--- ../tmp/xrdp/vnc/vnc.c 2011-08-13 17:15:15.000000000 +0200
+++ vnc/vnc.c 2011-10-24 23:45:39.000000000 +0200
@@ -603,6 +603,26 @@
}
error = v->server_set_cursor(v, x, y, cursor_data, cursor_mask);
}
+ } else if(encoding == 0xffffff21) /* DesktopSize */
+ {
+ g_writeln("Got DesktopSize message: %i %i %i %i", x, y, cx, cy);
+ v->server_width=cx;
+ v->server_height=cy;
+ v->mod_width=cx;
+ v->mod_height=cy;
+ v->server_reset(v, v->mod_width, v->mod_height, v->mod_bpp);
+ v->server_reset_clip(v);
+
+ /* Ask for a full update */
+ init_stream(s, 8192);
+ out_uint8(s, 3);
+ out_uint8(s, 0);
+ out_uint16_be(s, 0);
+ out_uint16_be(s, 0);
+ out_uint16_be(s, v->mod_width);
+ out_uint16_be(s, v->mod_height);
+ v->server_msg(v, "XrandR: Resolution changed", 0);
+ error = lib_send(v, s->data, 10);
}
else
{
@@ -1028,12 +1048,13 @@
init_stream(s, 8192);
out_uint8(s, 2);
out_uint8(s, 0);
- out_uint16_be(s, 3);
+ out_uint16_be(s, 4);
out_uint32_be(s, 0); /* raw */
out_uint32_be(s, 1); /* copy rect */
out_uint32_be(s, 0xffffff11); /* cursor */
+ out_uint32_be(s, 0xffffff21); /* DesktopSize */
v->server_msg(v, "sending encodings", 0);
- error = lib_send(v, s->data, 4 + 3 * 4);
+ error = lib_send(v, s->data, 4 + 4 * 4);
}
if (error == 0)
{
###
--
Daniel Nebdal
OUS/IKF/Department of genetics
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
xrdp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xrdp-devel