[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/18] ui/vdagent: send empty clipboard when unhandled
From: |
marcandre . lureau |
Subject: |
[PULL 14/18] ui/vdagent: send empty clipboard when unhandled |
Date: |
Tue, 31 Aug 2021 17:31:28 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Rather than leaving the agent timing out or hanging, reply to it with an
empty result.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210805135715.857938-15-marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
---
ui/vdagent.c | 12 ++++++++++++
ui/trace-events | 1 +
2 files changed, 13 insertions(+)
diff --git a/ui/vdagent.c b/ui/vdagent.c
index cd07937a4b..cd49da1ffa 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -375,6 +375,16 @@ static void vdagent_send_clipboard_data(VDAgentChardev *vd,
vdagent_send_msg(vd, msg);
}
+static void vdagent_send_empty_clipboard_data(VDAgentChardev *vd,
+ QemuClipboardSelection selection,
+ QemuClipboardType type)
+{
+ g_autoptr(QemuClipboardInfo) info = qemu_clipboard_info_new(&vd->cbpeer,
selection);
+
+ trace_vdagent_send_empty_clipboard();
+ vdagent_send_clipboard_data(vd, info, type);
+}
+
static void vdagent_clipboard_notify(Notifier *notifier, void *data)
{
VDAgentChardev *vd = container_of(notifier, VDAgentChardev, cbpeer.update);
@@ -482,6 +492,8 @@ static void vdagent_clipboard_recv_request(VDAgentChardev
*vd, uint8_t s, uint32
vd->cbpending[s] |= (1 << type);
qemu_clipboard_request(info, type);
}
+ } else {
+ vdagent_send_empty_clipboard_data(vd, s, type);
}
}
diff --git a/ui/trace-events b/ui/trace-events
index 1b5f87bc09..b9c0dd0fa1 100644
--- a/ui/trace-events
+++ b/ui/trace-events
@@ -129,6 +129,7 @@ xkeymap_keymap(const char *name) "keymap '%s'"
vdagent_open(void) ""
vdagent_close(void) ""
vdagent_send(const char *name) "msg %s"
+vdagent_send_empty_clipboard(void) ""
vdagent_recv_chunk(uint32_t size) "size %d"
vdagent_recv_msg(const char *name, uint32_t size) "msg %s, size %d"
vdagent_peer_cap(const char *name) "cap %s"
--
2.33.0.rc2
- [PULL 04/18] ui/gtk-clipboard: fix clipboard enum typo, (continued)
- [PULL 04/18] ui/gtk-clipboard: fix clipboard enum typo, marcandre . lureau, 2021/08/31
- [PULL 05/18] ui/clipboard: add helper to retrieve current clipboard, marcandre . lureau, 2021/08/31
- [PULL 06/18] ui/clipboard: add qemu_clipboard_peer_owns() helper, marcandre . lureau, 2021/08/31
- [PULL 07/18] ui/clipboard: add qemu_clipboard_peer_release() helper, marcandre . lureau, 2021/08/31
- [PULL 08/18] ui/clipboard: release owned grabs on unregister, marcandre . lureau, 2021/08/31
- [PULL 09/18] ui/vdagent: disconnect handlers and reset state on finalize, marcandre . lureau, 2021/08/31
- [PULL 10/18] ui/vdagent: reset outbuf on disconnect, marcandre . lureau, 2021/08/31
- [PULL 11/18] ui/vdagent: split clipboard recv message handling, marcandre . lureau, 2021/08/31
- [PULL 12/18] ui/vdagent: use qemu_clipboard_peer_release helper, marcandre . lureau, 2021/08/31
- [PULL 13/18] ui/vdagent: use qemu_clipboard_info helper, marcandre . lureau, 2021/08/31
- [PULL 14/18] ui/vdagent: send empty clipboard when unhandled,
marcandre . lureau <=
- [PULL 15/18] ui/gtk-clipboard: use qemu_clipboard_info helper, marcandre . lureau, 2021/08/31
- [PULL 16/18] ui/vdagent: send release when no clipboard owner, marcandre . lureau, 2021/08/31
- [PULL 17/18] ui/gtk-clipboard: emit release clipboard events, marcandre . lureau, 2021/08/31
- [PULL 18/18] ui/vdagent: add a migration blocker, marcandre . lureau, 2021/08/31
- Re: [PULL 00/18] UI/clipboard fixes, Peter Maydell, 2021/08/31