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>
This commit is contained in:
parent
684e64d36d
commit
482bbaf477
@ -109,6 +109,17 @@ void qemu_clipboard_peer_register(QemuClipboardPeer *peer);
|
||||
*/
|
||||
void qemu_clipboard_peer_unregister(QemuClipboardPeer *peer);
|
||||
|
||||
/**
|
||||
* qemu_clipboard_peer_owns
|
||||
*
|
||||
* @peer: peer information.
|
||||
* @selection: clipboard selection.
|
||||
*
|
||||
* Return TRUE if the peer owns the clipboard.
|
||||
*/
|
||||
bool qemu_clipboard_peer_owns(QemuClipboardPeer *peer,
|
||||
QemuClipboardSelection selection);
|
||||
|
||||
/**
|
||||
* qemu_clipboard_info
|
||||
*
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user