diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-07-21 15:19:13 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-12-21 10:50:21 +0400 |
commit | 349504e5a1533c795cd5f72e629766b996982050 (patch) | |
tree | 223a292a769b4a5c97177388835934a35dc19ff9 /ui/clipboard.c | |
parent | 835f69f4e64e2285253bae57f618a75a2756f27c (diff) |
ui/clipboard: add qemu_clipboard_check_serial()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/clipboard.c')
-rw-r--r-- | ui/clipboard.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ui/clipboard.c b/ui/clipboard.c index 743b39edf4..ffbd80e5c6 100644 --- a/ui/clipboard.c +++ b/ui/clipboard.c @@ -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 = { |