summaryrefslogtreecommitdiffstats
path: root/ui/vnc.c
diff options
context:
space:
mode:
authorPeter Maydell2021-05-21 15:27:56 +0200
committerPeter Maydell2021-05-21 15:27:56 +0200
commit3bbaed2cd0a02ee53958d3d2585e837bcf327278 (patch)
tree5aa2fb8262bc53f817d6aab6f4a9947ddcf1db40 /ui/vnc.c
parentMerge remote-tracking branch 'remotes/vsementsov/tags/pull-simplebench-2021-0... (diff)
parentui/gtk: add clipboard support (diff)
downloadqemu-3bbaed2cd0a02ee53958d3d2585e837bcf327278.tar.gz
qemu-3bbaed2cd0a02ee53958d3d2585e837bcf327278.tar.xz
qemu-3bbaed2cd0a02ee53958d3d2585e837bcf327278.zip
Merge remote-tracking branch 'remotes/kraxel/tags/ui-20210521-pull-request' into staging
ui: add cut+paste support. ui: bugfixes for spice and vnc. # gpg: Signature made Fri 21 May 2021 13:50:46 BST # gpg: using RSA key A0328CFFB93A17A79901FE7D4CB6D8EED3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" [full] # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" [full] # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" [full] # Primary key fingerprint: A032 8CFF B93A 17A7 9901 FE7D 4CB6 D8EE D3E8 7138 * remotes/kraxel/tags/ui-20210521-pull-request: ui/gtk: add clipboard support ui/gtk: move struct GtkDisplayState to ui/gtk.h ui/vnc: clipboard support ui/vdagent: add clipboard support ui/vdagent: add mouse support ui/vdagent: core infrastructure ui: add clipboard documentation ui: add clipboard infrastructure build: add separate spice-protocol config option ui/spice-display: check NULL pointer in interface_release_resource() vnc: spelling fix (enable->enabled) Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'ui/vnc.c')
-rw-r--r--ui/vnc.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/ui/vnc.c b/ui/vnc.c
index 456db47d71..b3d4d7b9a5 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -25,6 +25,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu-common.h"
#include "vnc.h"
#include "vnc-jobs.h"
#include "trace.h"
@@ -596,7 +597,7 @@ bool vnc_display_reload_certs(const char *id, Error **errp)
}
if (!vd->tlscreds) {
- error_setg(errp, "vnc tls is not enable");
+ error_setg(errp, "vnc tls is not enabled");
return false;
}
@@ -1352,6 +1353,9 @@ void vnc_disconnect_finish(VncState *vs)
/* last client gone */
vnc_update_server_surface(vs->vd);
}
+ if (vs->cbpeer.update.notify) {
+ qemu_clipboard_peer_unregister(&vs->cbpeer);
+ }
vnc_unlock_output(vs);
@@ -1777,10 +1781,6 @@ uint32_t read_u32(uint8_t *data, size_t offset)
(data[offset + 2] << 8) | data[offset + 3]);
}
-static void client_cut_text(VncState *vs, size_t len, uint8_t *text)
-{
-}
-
static void check_pointer_type_change(Notifier *notifier, void *data)
{
VncState *vs = container_of(notifier, VncState, mouse_mode_notifier);
@@ -2222,6 +2222,10 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
send_xvp_message(vs, VNC_XVP_CODE_INIT);
}
break;
+ case VNC_ENCODING_CLIPBOARD_EXT:
+ vs->features |= VNC_FEATURE_CLIPBOARD_EXT_MASK;
+ vnc_server_cut_text_caps(vs);
+ break;
case VNC_ENCODING_COMPRESSLEVEL0 ... VNC_ENCODING_COMPRESSLEVEL0 + 9:
vs->tight->compression = (enc & 0x0F);
break;
@@ -2438,7 +2442,7 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
return 8;
}
if (len == 8) {
- uint32_t dlen = read_u32(data, 4);
+ uint32_t dlen = abs(read_s32(data, 4));
if (dlen > (1 << 20)) {
error_report("vnc: client_cut_text msg payload has %u bytes"
" which exceeds our limit of 1MB.", dlen);
@@ -2450,7 +2454,12 @@ static int protocol_client_msg(VncState *vs, uint8_t *data, size_t len)
}
}
- client_cut_text(vs, read_u32(data, 4), data + 8);
+ if (read_s32(data, 4) < 0) {
+ vnc_client_cut_text_ext(vs, abs(read_s32(data, 4)),
+ read_u32(data, 8), data + 12);
+ break;
+ }
+ vnc_client_cut_text(vs, read_u32(data, 4), data + 8);
break;
case VNC_MSG_CLIENT_XVP:
if (!(vs->features & VNC_FEATURE_XVP)) {