xrdp/xrdp-fate319683-allow-vnc-resizing.patch
Tomáš Chvátal 30dd9ac408 Accepting request 737648 from home:zhangxiaofei:branches:X11:RemoteDesktop
- Update to version 0.9.11 (jsc#9612)
  + New features
    - Suppress output (do not draw screen when client window is
      minimized) #1330
    - Audio input (microphone) redirection compatible with
      MS-RDPEAI #1369
    - Now xrdp can listen on more than one port #1124 #1366
  + Bug fixes
    - Fix the issue audio redirection sometimes sounds with long
      delay #1363
    - Check term event for more responsive shutdown #1372
  + Known issues
    - FreeRDP 2.0.0-rc4 or later might not able to connect to xrdp
      due to xrdp's bad-mannered behaviour, add +glyph-cache option
      to FreeRDP to connect #1266
    - Audio redirection by MP3 codec doesn't sound with some
      client, use AAC instead #965
- Rebase xrdp-avahi.diff, worked around stdint.h definitions
- Rebase xrdp-fate319683-allow-vnc-resizing.patch

OBS-URL: https://build.opensuse.org/request/show/737648
OBS-URL: https://build.opensuse.org/package/show/X11:RemoteDesktop/xrdp?expand=0&rev=64
2019-10-14 06:43:52 +00:00

130 lines
5.0 KiB
Diff

Index: b/sesman/sesman.ini
===================================================================
--- a/sesman/sesman.ini 2019-10-12 17:45:30.594432280 +0800
+++ b/sesman/sesman.ini 2019-10-12 17:45:37.222491421 +0800
@@ -55,7 +55,7 @@ IdleTimeLimit=0
;; Policy - session allocation policy
; Type: enum [ "Default" | "UBD" | "UBI" | "UBC" | "UBDI" | "UBDC" ]
-; Default: Xrdp:<User,BitPerPixel> and Xvnc:<User,BitPerPixel,DisplaySize>
+; Default: Xrdp and Xvnc:<User,BitPerPixel>
; "UBD" session per <User,BitPerPixel,DisplaySize>
; "UBI" session per <User,BitPerPixel,IPAddr>
; "UBC" session per <User,BitPerPixel,Connection>
Index: b/sesman/session.c
===================================================================
--- a/sesman/session.c 2019-10-12 17:45:30.598432316 +0800
+++ b/sesman/session.c 2019-10-12 17:45:37.222491421 +0800
@@ -105,9 +105,6 @@ session_get_bydata(const char *name, int
{
case SCP_SESSION_TYPE_XVNC: /* 0 */
type = SESMAN_SESSION_TYPE_XVNC; /* 2 */
- /* Xvnc cannot resize */
- policy = (enum SESMAN_CFG_SESS_POLICY)
- (policy | SESMAN_CFG_SESS_POLICY_D);
break;
case SCP_SESSION_TYPE_XRDP: /* 1 */
type = SESMAN_SESSION_TYPE_XRDP; /* 1 */
Index: b/vnc/vnc.c
===================================================================
--- a/vnc/vnc.c 2019-10-12 17:45:30.598432316 +0800
+++ b/vnc/vnc.c 2019-10-12 17:49:39.956657294 +0800
@@ -385,7 +385,8 @@ lib_mod_event(struct vnc *v, int msg, lo
/* FramebufferUpdateRequest */
init_stream(s, 8192);
out_uint8(s, 3);
- out_uint8(s, 0);
+ out_uint8(s, v->incremental);
+ v->incremental = 1;
x = (param1 >> 16) & 0xffff;
out_uint16_be(s, x);
y = param1 & 0xffff;
@@ -727,7 +728,24 @@ lib_framebuffer_update(struct vnc *v)
{
v->mod_width = cx;
v->mod_height = cy;
- error = v->server_reset(v, cx, cy, v->mod_bpp);
+ }
+ else if (encoding == 0xfffffecc) /* extended desktop resize */
+ {
+ init_stream(s, 8192);
+ error = trans_force_read_s(v->trans, s, 4);
+ if (error == 0)
+ {
+ in_uint8(s, k); /* number of screens */
+ in_uint8s(s, 3);
+ error = trans_force_read_s(v->trans, s, k * 16);
+ if (error == 0)
+ {
+ in_uint8s(s, k * 16); /* skip screen list */
+ /* note new dimensions for later */
+ v->server_width = cx;
+ v->server_height = cy;
+ }
+ }
}
else
{
@@ -743,6 +761,15 @@ lib_framebuffer_update(struct vnc *v)
error = v->server_end_update(v);
}
+ if (v->mod_width != v->server_width || v->mod_height != v->server_height)
+ {
+ /* perform actual resize outside the update */
+ v->mod_width = v->server_width;
+ v->mod_height = v->server_height;
+ error = v->server_reset(v, v->mod_width, v->mod_height, v->mod_bpp);
+ v->incremental = 0;
+ }
+
if (error == 0)
{
if (v->suppress_output == 0)
@@ -750,7 +777,8 @@ lib_framebuffer_update(struct vnc *v)
/* FramebufferUpdateRequest */
init_stream(s, 8192);
out_uint8(s, 3);
- out_uint8(s, 1);
+ out_uint8(s, v->incremental);
+ v->incremental = 1;
out_uint16_be(s, 0);
out_uint16_be(s, 0);
out_uint16_be(s, v->mod_width);
@@ -1333,11 +1361,12 @@ lib_mod_connect(struct vnc *v)
init_stream(s, 8192);
out_uint8(s, 2);
out_uint8(s, 0);
- out_uint16_be(s, 4);
+ out_uint16_be(s, 5);
out_uint32_be(s, 0); /* raw */
out_uint32_be(s, 1); /* copy rect */
out_uint32_be(s, 0xffffff11); /* cursor */
out_uint32_be(s, 0xffffff21); /* desktop size */
+ out_uint32_be(s, 0xfffffecc); /* extended desktop resize */
v->server_msg(v, "VNC sending encodings", 0);
s_mark_end(s);
error = trans_force_write_s(v->trans, s);
@@ -1530,7 +1559,8 @@ lib_mod_suppress_output(struct vnc* v, i
make_stream(s);
init_stream(s, 8192);
out_uint8(s, 3);
- out_uint8(s, 0);
+ out_uint8(s, v->incremental);
+ v->incremental = 1;
out_uint16_be(s, 0);
out_uint16_be(s, 0);
out_uint16_be(s, v->mod_width);
Index: b/vnc/vnc.h
===================================================================
--- a/vnc/vnc.h 2019-10-12 17:45:30.598432316 +0800
+++ b/vnc/vnc.h 2019-10-12 17:45:37.222491421 +0800
@@ -116,6 +116,7 @@ struct vnc
int clip_chanid;
struct stream *clip_data_s;
int delay_ms;
+ int incremental;
struct trans *trans;
int got_guid;
tui8 guid[16];