Accepting request 484050 from home:zhangxiaofei:branches:X11:RemoteDesktop

- 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).

OBS-URL: https://build.opensuse.org/request/show/484050
OBS-URL: https://build.opensuse.org/package/show/X11:RemoteDesktop/xrdp?expand=0&rev=11
This commit is contained in:
Dirk Mueller 2017-04-04 07:12:31 +00:00 committed by Git OBS Bridge
parent 7e30f7d5b5
commit 1c8420a047
3 changed files with 127 additions and 1 deletions

View File

@ -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;
};

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
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

View File

@ -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