Skip to content
Snippets Groups Projects
Commit 349504e5 authored by Marc-André Lureau's avatar Marc-André Lureau
Browse files

ui/clipboard: add qemu_clipboard_check_serial()


Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 835f69f4
No related branches found
No related tags found
No related merge requests found
......@@ -172,6 +172,16 @@ void qemu_clipboard_peer_release(QemuClipboardPeer *peer,
*/
QemuClipboardInfo *qemu_clipboard_info(QemuClipboardSelection selection);
/**
* qemu_clipboard_check_serial
*
* @info: clipboard info.
* @client: whether to check from the client context and priority.
*
* Return TRUE if the @info has a higher serial than the current clipboard.
*/
bool qemu_clipboard_check_serial(QemuClipboardInfo *info, bool client);
/**
* qemu_clipboard_info_new
*
......
......@@ -41,6 +41,21 @@ void qemu_clipboard_peer_release(QemuClipboardPeer *peer,
}
}
bool qemu_clipboard_check_serial(QemuClipboardInfo *info, bool client)
{
if (!info->has_serial ||
!cbinfo[info->selection] ||
!cbinfo[info->selection]->has_serial) {
return true;
}
if (client) {
return cbinfo[info->selection]->serial >= info->serial;
} else {
return cbinfo[info->selection]->serial > info->serial;
}
}
void qemu_clipboard_update(QemuClipboardInfo *info)
{
QemuClipboardNotify notify = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment