[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/4] ui/vdagent: notify clipboard peers of serial reset
From: |
marcandre . lureau |
Subject: |
[PATCH 3/4] ui/vdagent: notify clipboard peers of serial reset |
Date: |
Wed, 17 Jul 2024 21:15:39 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
Since we reset the serial counters, peers should also be reset to be sync.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
ui/clipboard.c | 2 ++
ui/vdagent.c | 2 ++
ui/trace-events | 1 +
3 files changed, 5 insertions(+)
diff --git a/ui/clipboard.c b/ui/clipboard.c
index 4264884a6c..132086eb13 100644
--- a/ui/clipboard.c
+++ b/ui/clipboard.c
@@ -155,6 +155,8 @@ void qemu_clipboard_reset_serial(void)
QemuClipboardNotify notify = { .type = QEMU_CLIPBOARD_RESET_SERIAL };
int i;
+ trace_clipboard_reset_serial();
+
for (i = 0; i < QEMU_CLIPBOARD_SELECTION__COUNT; i++) {
QemuClipboardInfo *info = qemu_clipboard_info(i);
if (info) {
diff --git a/ui/vdagent.c b/ui/vdagent.c
index cb74739bc4..2a4b3574b1 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -720,6 +720,8 @@ static void vdagent_chr_recv_caps(VDAgentChardev *vd,
VDAgentMessage *msg)
memset(vd->last_serial, 0, sizeof(vd->last_serial));
if (have_clipboard(vd) && vd->cbpeer.notifier.notify == NULL) {
+ qemu_clipboard_reset_serial();
+
vd->cbpeer.name = "vdagent";
vd->cbpeer.notifier.notify = vdagent_clipboard_notify;
vd->cbpeer.request = vdagent_clipboard_request;
diff --git a/ui/trace-events b/ui/trace-events
index f5faa149d2..fb253c1666 100644
--- a/ui/trace-events
+++ b/ui/trace-events
@@ -130,6 +130,7 @@ xkeymap_keymap(const char *name) "keymap '%s'"
# clipboard.c
clipboard_check_serial(int cur, int recv, bool ok) "cur:%d recv:%d %d"
+clipboard_reset_serial(void) ""
# vdagent.c
vdagent_fe_open(bool fe_open) "fe_open=%d"
--
2.45.2.827.g557ae147e6
- [PATCH 0/4] ui: fixes for dbus clipboard hanling, marcandre . lureau, 2024/07/17
- [PATCH 1/4] ui: add more tracing for dbus, marcandre . lureau, 2024/07/17
- [PATCH 2/4] ui/vdagent: improve vdagent_fe_open() trace, marcandre . lureau, 2024/07/17
- [PATCH 3/4] ui/vdagent: notify clipboard peers of serial reset,
marcandre . lureau <=
- [PATCH 4/4] ui/vdagent: send caps on fe_open, marcandre . lureau, 2024/07/17
- Re: [PATCH 0/4] ui: fixes for dbus clipboard hanling, Philippe Mathieu-Daudé, 2024/07/18
- Re: [PATCH 0/4] ui: fixes for dbus clipboard hanling, Akihiko Odaki, 2024/07/23