aboutsummaryrefslogtreecommitdiff
path: root/ui/clipboard.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2022-09-12 14:24:54 +0400
committerGerd Hoffmann <kraxel@redhat.com>2022-09-23 14:38:27 +0200
commit72ce36f77ca6fe8cf9aae5ed28d7c3c865ef887d (patch)
tree99bca634fa94af8d4ce59b0651a0f93e902c56d6 /ui/clipboard.c
parente46d4d684224872b8b5999a51c688ee8fffb4a1b (diff)
downloadqemu-72ce36f77ca6fe8cf9aae5ed28d7c3c865ef887d.zip
qemu-72ce36f77ca6fe8cf9aae5ed28d7c3c865ef887d.tar.gz
qemu-72ce36f77ca6fe8cf9aae5ed28d7c3c865ef887d.tar.bz2
ui/clipboard: reset the serial state on reset
Not only we have to reset the vdagent clipboards serial state, but also the current QEMU clipboards info serial (the value is currently used by qemu_clipboard_check_serial, only used by -display dbus). Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20220912102455.111765-5-marcandre.lureau@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/clipboard.c')
-rw-r--r--ui/clipboard.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/clipboard.c b/ui/clipboard.c
index 3e2d02d..3d14bff 100644
--- a/ui/clipboard.c
+++ b/ui/clipboard.c
@@ -139,7 +139,14 @@ void qemu_clipboard_request(QemuClipboardInfo *info,
void qemu_clipboard_reset_serial(void)
{
QemuClipboardNotify notify = { .type = QEMU_CLIPBOARD_RESET_SERIAL };
+ int i;
+ for (i = 0; i < QEMU_CLIPBOARD_SELECTION__COUNT; i++) {
+ QemuClipboardInfo *info = qemu_clipboard_info(i);
+ if (info) {
+ info->serial = 0;
+ }
+ }
notifier_list_notify(&clipboard_notifiers, &notify);
}