diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-08-05 17:57:03 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-08-31 17:25:14 +0400 |
commit | 482bbaf4776d223971ec68ddd4d31d8861d31f1c (patch) | |
tree | 6a8acb007f1b8a2d4bf1567668e1b7e51dc76efe /ui | |
parent | 684e64d36d139c1473dd029661c20ba968c0fe53 (diff) |
ui/clipboard: add qemu_clipboard_peer_owns() helper
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20210805135715.857938-7-marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/clipboard.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ui/clipboard.c b/ui/clipboard.c index 56c14509fe..490c3220f4 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -16,6 +16,14 @@ void qemu_clipboard_peer_unregister(QemuClipboardPeer *peer) notifier_remove(&peer->update); } +bool qemu_clipboard_peer_owns(QemuClipboardPeer *peer, + QemuClipboardSelection selection) +{ + QemuClipboardInfo *info = qemu_clipboard_info(selection); + + return info && info->owner == peer; +} + void qemu_clipboard_update(QemuClipboardInfo *info) { g_autoptr(QemuClipboardInfo) old = NULL; |