aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2021-07-19 19:49:56 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2021-12-21 10:50:21 +0400
commit505dbf9b99e937853c02d7995f9eebe95508e8d4 (patch)
tree1e710bb13a8d7d17045636fe98bca04b349a2812 /ui
parent349504e5a1533c795cd5f72e629766b996982050 (diff)
ui/clipboard: add a clipboard reset serial event
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/clipboard.c7
-rw-r--r--ui/cocoa.m3
-rw-r--r--ui/gtk-clipboard.c3
-rw-r--r--ui/vdagent.c12
-rw-r--r--ui/vnc-clipboard.c3
5 files changed, 28 insertions, 0 deletions
diff --git a/ui/clipboard.c b/ui/clipboard.c
index ffbd80e5c6..82572ea116 100644
--- a/ui/clipboard.c
+++ b/ui/clipboard.c
@@ -129,6 +129,13 @@ void qemu_clipboard_request(QemuClipboardInfo *info,
info->owner->request(info, type);
}
+void qemu_clipboard_reset_serial(void)
+{
+ QemuClipboardNotify notify = { .type = QEMU_CLIPBOARD_RESET_SERIAL };
+
+ notifier_list_notify(&clipboard_notifiers, &notify);
+}
+
void qemu_clipboard_set_data(QemuClipboardPeer *peer,
QemuClipboardInfo *info,
QemuClipboardType type,
diff --git a/ui/cocoa.m b/ui/cocoa.m
index 6640a2e80e..7ca429fa80 100644
--- a/ui/cocoa.m
+++ b/ui/cocoa.m
@@ -1837,6 +1837,9 @@ static void cocoa_clipboard_notify(Notifier *notifier, void *data)
case QEMU_CLIPBOARD_UPDATE_INFO:
cocoa_clipboard_update_info(notify->info);
return;
+ case QEMU_CLIPBOARD_RESET_SERIAL:
+ /* ignore */
+ return;
}
}
diff --git a/ui/gtk-clipboard.c b/ui/gtk-clipboard.c
index 44ff810234..e0b8b283fe 100644
--- a/ui/gtk-clipboard.c
+++ b/ui/gtk-clipboard.c
@@ -127,6 +127,9 @@ static void gd_clipboard_notify(Notifier *notifier, void *data)
case QEMU_CLIPBOARD_UPDATE_INFO:
gd_clipboard_update_info(gd, notify->info);
return;
+ case QEMU_CLIPBOARD_RESET_SERIAL:
+ /* ignore */
+ return;
}
}
diff --git a/ui/vdagent.c b/ui/vdagent.c
index b4fdae6917..7ea4bc5d9a 100644
--- a/ui/vdagent.c
+++ b/ui/vdagent.c
@@ -466,6 +466,15 @@ static void vdagent_clipboard_update_info(VDAgentChardev *vd,
}
}
+static void vdagent_clipboard_reset_serial(VDAgentChardev *vd)
+{
+ Chardev *chr = CHARDEV(vd);
+
+ /* reopen the agent connection to reset the serial state */
+ qemu_chr_be_event(chr, CHR_EVENT_CLOSED);
+ qemu_chr_be_event(chr, CHR_EVENT_OPENED);
+}
+
static void vdagent_clipboard_notify(Notifier *notifier, void *data)
{
VDAgentChardev *vd =
@@ -476,6 +485,9 @@ static void vdagent_clipboard_notify(Notifier *notifier, void *data)
case QEMU_CLIPBOARD_UPDATE_INFO:
vdagent_clipboard_update_info(vd, notify->info);
return;
+ case QEMU_CLIPBOARD_RESET_SERIAL:
+ vdagent_clipboard_reset_serial(vd);
+ return;
}
}
diff --git a/ui/vnc-clipboard.c b/ui/vnc-clipboard.c
index 6a0b105884..d48f75eb1a 100644
--- a/ui/vnc-clipboard.c
+++ b/ui/vnc-clipboard.c
@@ -230,6 +230,9 @@ static void vnc_clipboard_notify(Notifier *notifier, void *data)
case QEMU_CLIPBOARD_UPDATE_INFO:
vnc_clipboard_update_info(vs, notify->info);
return;
+ case QEMU_CLIPBOARD_RESET_SERIAL:
+ /* ignore */
+ return;
}
}