diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-09-12 14:24:53 +0400 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2022-09-23 14:38:27 +0200 |
commit | e46d4d684224872b8b5999a51c688ee8fffb4a1b (patch) | |
tree | dedc9bde7a6b2206f76d6deaa379706902ecb6be | |
parent | 0e23ae9c657d65049e5ef3a06451b22830964f35 (diff) | |
download | qemu-e46d4d684224872b8b5999a51c688ee8fffb4a1b.zip qemu-e46d4d684224872b8b5999a51c688ee8fffb4a1b.tar.gz qemu-e46d4d684224872b8b5999a51c688ee8fffb4a1b.tar.bz2 |
ui/vdagent: always reset the clipboard serial on caps
The guest agent doesn't know what is the current serial state. Reset the
serial value whenever a new agent connection is established.
Fixes:
https://bugzilla.redhat.com/show_bug.cgi?id=2124446
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220912102455.111765-4-marcandre.lureau@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | ui/vdagent.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/vdagent.c b/ui/vdagent.c index 58ce750..819e0dc 100644 --- a/ui/vdagent.c +++ b/ui/vdagent.c @@ -719,8 +719,10 @@ static void vdagent_chr_recv_caps(VDAgentChardev *vd, VDAgentMessage *msg) if (have_mouse(vd) && vd->mouse_hs) { qemu_input_handler_activate(vd->mouse_hs); } + + memset(vd->last_serial, 0, sizeof(vd->last_serial)); + if (have_clipboard(vd) && vd->cbpeer.notifier.notify == NULL) { - memset(vd->last_serial, 0, sizeof(vd->last_serial)); vd->cbpeer.name = "vdagent"; vd->cbpeer.notifier.notify = vdagent_clipboard_notify; vd->cbpeer.request = vdagent_clipboard_request; |