[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 6/8] ui/vdagent: notify clipboard peers of serial reset
From: |
marcandre . lureau |
Subject: |
[PULL 6/8] ui/vdagent: notify clipboard peers of serial reset |
Date: |
Tue, 23 Jul 2024 00:06:16 +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>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240717171541.201525-4-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
- [PULL 0/8] Ui patches, marcandre . lureau, 2024/07/22
- [PULL 1/8] vnc: increase max display size, marcandre . lureau, 2024/07/22
- [PULL 2/8] virtio-gpu-gl: declare dependency on ui-opengl, marcandre . lureau, 2024/07/22
- [PULL 3/8] Cursor: 8 -> 1 bit alpha downsampling improvement, marcandre . lureau, 2024/07/22
- [PULL 4/8] ui: add more tracing for dbus, marcandre . lureau, 2024/07/22
- [PULL 5/8] ui/vdagent: improve vdagent_fe_open() trace, marcandre . lureau, 2024/07/22
- [PULL 7/8] ui/vdagent: send caps on fe_open, marcandre . lureau, 2024/07/22
- [PULL 6/8] ui/vdagent: notify clipboard peers of serial reset,
marcandre . lureau <=
- [PULL 8/8] chardev/char-win-stdio.c: restore old console mode, marcandre . lureau, 2024/07/22
- Re: [PULL 0/8] Ui patches, Philippe Mathieu-Daudé, 2024/07/22
- Re: [PULL 0/8] Ui patches, Richard Henderson, 2024/07/23