aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2021-08-05 17:57:04 +0400
committerMarc-André Lureau <marcandre.lureau@redhat.com>2021-08-31 17:25:14 +0400
commit1387865eca16984fc6d57702ac9e999527681b22 (patch)
tree20ff9afc790becdedd001ec16c5db4cb5827b39b /ui
parent482bbaf4776d223971ec68ddd4d31d8861d31f1c (diff)
ui/clipboard: add qemu_clipboard_peer_release() helper
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Message-Id: <20210805135715.857938-8-marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r--ui/clipboard.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/clipboard.c b/ui/clipboard.c
index 490c3220f4..c277247a7f 100644
--- a/ui/clipboard.c
+++ b/ui/clipboard.c
@@ -24,6 +24,18 @@ bool qemu_clipboard_peer_owns(QemuClipboardPeer *peer,
return info && info->owner == peer;
}
+void qemu_clipboard_peer_release(QemuClipboardPeer *peer,
+ QemuClipboardSelection selection)
+{
+ g_autoptr(QemuClipboardInfo) info = NULL;
+
+ if (qemu_clipboard_peer_owns(peer, selection)) {
+ /* set empty clipboard info */
+ info = qemu_clipboard_info_new(NULL, selection);
+ qemu_clipboard_update(info);
+ }
+}
+
void qemu_clipboard_update(QemuClipboardInfo *info)
{
g_autoptr(QemuClipboardInfo) old = NULL;