diff --git a/xrdp-fate319683-allow-vnc-resizing.patch b/xrdp-fate319683-allow-vnc-resizing.patch new file mode 100644 index 0000000..2646b12 --- /dev/null +++ b/xrdp-fate319683-allow-vnc-resizing.patch @@ -0,0 +1,114 @@ +diff --git a/sesman/session.c b/sesman/session.c +index 4ea48d3..def4179 100644 +--- a/sesman/session.c ++++ b/sesman/session.c +@@ -105,7 +105,6 @@ session_get_bydata(char *name, int width, int height, int bpp, int type, char *c + { + case SCP_SESSION_TYPE_XVNC: /* 0 */ + type = SESMAN_SESSION_TYPE_XVNC; /* 2 */ +- policy |= SESMAN_CFG_SESS_POLICY_D; /* Xvnc cannot resize */ + break; + case SCP_SESSION_TYPE_XRDP: /* 1 */ + type = SESMAN_SESSION_TYPE_XRDP; /* 1 */ +diff --git a/vnc/vnc.c b/vnc/vnc.c +index c3ee3bf..03bb5b5 100644 +--- a/vnc/vnc.c ++++ b/vnc/vnc.c +@@ -359,7 +359,8 @@ lib_mod_event(struct vnc *v, int msg, long param1, long param2, + /* FrambufferUpdateRequest */ + 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; +@@ -707,7 +708,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 = lib_recv(v, s->data, 4); ++ if (error == 0) ++ { ++ in_uint8(s, k); /* number of screens */ ++ in_uint8s(s, 3); ++ error = lib_recv(v, s->data, 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 + { +@@ -724,13 +742,23 @@ lib_framebuffer_update(struct vnc *v) + } + + g_free(data); ++ free_stream(s); ++ 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) + { + /* FrambufferUpdateRequest */ + 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); +@@ -1238,13 +1266,14 @@ 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); +- error = lib_send(v, s->data, 4 + 4 * 4); ++ error = lib_send(v, s->data, 4 + 5 * 4); + } + + if (error == 0) +@@ -1257,7 +1286,8 @@ lib_mod_connect(struct vnc *v) + /* FrambufferUpdateRequest */ + 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); +diff --git a/vnc/vnc.h b/vnc/vnc.h +index 6d265be..69e899b 100644 +--- a/vnc/vnc.h ++++ b/vnc/vnc.h +@@ -116,4 +116,5 @@ struct vnc + int clip_data_size; + tbus sck_obj; + int delay_ms; ++ int incremental; + }; diff --git a/xrdp.changes b/xrdp.changes index a31fbe2..003274b 100644 --- a/xrdp.changes +++ b/xrdp.changes @@ -1,7 +1,16 @@ +------------------------------------------------------------------- +Mon Feb 6 10:31:26 UTC 2017 - fezhang@suse.com + +- Add xrdp-fate319683-allow-vnc-resizing.patch: + Add support for ExtendedDesktopSize VNC extension into xrdp's VNC + client to allow it to do resizing, so that returning clients can + reconnect to session if their resolutions changed (FATE#319683, + bsc#948062). + ------------------------------------------------------------------- Wed Feb 1 12:14:29 CET 2017 - vliaskovitis@suse.com -- Backport upstream patches for 32bpp support (bsc#1022098) +- Backport upstream patches for 32bpp support (bsc#1022098) - Add xrdp-Allow-sessions-with-32-bpp.patch.patch - Add xrdp-vnc-enable-32-bpp-support-for-Xvnc-it-actually-works.patch - Add xrdp-Fix-support-for-32-bpp-clients-connecting-to-16-bpp-.patch diff --git a/xrdp.spec b/xrdp.spec index 8ae3407..336d3da 100644 --- a/xrdp.spec +++ b/xrdp.spec @@ -52,6 +52,8 @@ Patch12: xrdp-filter-tab-from-mstsc-on-focus-change.patch Patch13: xrdp-bsc965647-allow-admin-choose-desktop.patch # PATCH-FEATURE-SLE xrdp-fate318398-change-expired-password.patch fate#318398 - fezhang@suse.com -- enable user to update expired password via PAM Patch14: xrdp-fate318398-change-expired-password.patch +# PATCH-FEATURE-SLE xrdp-fate319683-allow-vnc-resizing.patch fate#319683 bsc#948062 - fezhang@suse.com -- allow resizing in VNC sessions +Patch15: xrdp-fate319683-allow-vnc-resizing.patch # PATCH-FIX-OPENSUSE xrdp-openSUSE-logo.patch - fezhang@suse.com -- use openSUSE logo in login dialog Patch21: xrdp-openSUSE-logo.patch BuildRequires: autoconf @@ -88,6 +90,7 @@ desktop clients. %patch12 -p1 %patch13 -p1 %patch14 -p1 +%patch15 -p1 %else %patch21 -p1 %endif