mirror of
https://github.com/qemu/qemu.git
synced 2024-12-02 16:23:35 +08:00
ui/clipboard: add qemu_clipboard_check_serial()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
835f69f4e6
commit
349504e5a1
@ -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 = {
|
||||
|
Loading…
Reference in New Issue
Block a user