From 1387865eca16984fc6d57702ac9e999527681b22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Thu, 5 Aug 2021 17:57:04 +0400 Subject: ui/clipboard: add qemu_clipboard_peer_release() helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20210805135715.857938-8-marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann --- ui/clipboard.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ui/clipboard.c') diff --git a/ui/clipboard.c b/ui/clipboard.c index 490c322..c277247 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; -- cgit v1.1