summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell2021-08-31 15:38:15 +0200
committerPeter Maydell2021-08-31 15:38:15 +0200
commitd52dff5d8048d4982437db9606c27bb4127cf9d0 (patch)
tree3159620ffcdfd8df6cdf8d5963a63d87db5291c5 /include
parentMerge remote-tracking branch 'remotes/dg-gitlab/tags/ppc-for-6.2-20210827' in... (diff)
parentui/vdagent: add a migration blocker (diff)
downloadqemu-d52dff5d8048d4982437db9606c27bb4127cf9d0.tar.gz
qemu-d52dff5d8048d4982437db9606c27bb4127cf9d0.tar.xz
qemu-d52dff5d8048d4982437db9606c27bb4127cf9d0.zip
Merge remote-tracking branch 'remotes/marcandre/tags/clip-pull-request' into staging
# gpg: Signature made Tue 31 Aug 2021 14:29:27 BST # gpg: using RSA key 87A9BD933F87C606D276F62DDAE8E10975969CE5 # gpg: issuer "marcandre.lureau@redhat.com" # gpg: Good signature from "Marc-André Lureau <marcandre.lureau@redhat.com>" [full] # gpg: aka "Marc-André Lureau <marcandre.lureau@gmail.com>" [full] # Primary key fingerprint: 87A9 BD93 3F87 C606 D276 F62D DAE8 E109 7596 9CE5 * remotes/marcandre/tags/clip-pull-request: ui/vdagent: add a migration blocker ui/gtk-clipboard: emit release clipboard events ui/vdagent: send release when no clipboard owner ui/gtk-clipboard: use qemu_clipboard_info helper ui/vdagent: send empty clipboard when unhandled ui/vdagent: use qemu_clipboard_info helper ui/vdagent: use qemu_clipboard_peer_release helper ui/vdagent: split clipboard recv message handling ui/vdagent: reset outbuf on disconnect ui/vdagent: disconnect handlers and reset state on finalize ui/clipboard: release owned grabs on unregister ui/clipboard: add qemu_clipboard_peer_release() helper ui/clipboard: add qemu_clipboard_peer_owns() helper ui/clipboard: add helper to retrieve current clipboard ui/gtk-clipboard: fix clipboard enum typo ui/gtk-clipboard: use existing macros ui/vdagent: remove copy-pasta comment ui/vdagent: fix leak on error path Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/ui/clipboard.h33
-rw-r--r--include/ui/gtk.h1
2 files changed, 33 insertions, 1 deletions
diff --git a/include/ui/clipboard.h b/include/ui/clipboard.h
index b45b984c9f..6298986b15 100644
--- a/include/ui/clipboard.h
+++ b/include/ui/clipboard.h
@@ -110,6 +110,37 @@ 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_peer_release
+ *
+ * @peer: peer information.
+ * @selection: clipboard selection.
+ *
+ * If the peer owns the clipboard, release it.
+ */
+void qemu_clipboard_peer_release(QemuClipboardPeer *peer,
+ QemuClipboardSelection selection);
+
+/**
+ * qemu_clipboard_info
+ *
+ * @selection: clipboard selection.
+ *
+ * Return the current clipboard data & owner informations.
+ */
+QemuClipboardInfo *qemu_clipboard_info(QemuClipboardSelection selection);
+
+/**
* qemu_clipboard_info_new
*
* @owner: clipboard owner.
@@ -190,4 +221,6 @@ void qemu_clipboard_set_data(QemuClipboardPeer *peer,
const void *data,
bool update);
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(QemuClipboardInfo, qemu_clipboard_info_unref)
+
#endif /* QEMU_CLIPBOARD_H */
diff --git a/include/ui/gtk.h b/include/ui/gtk.h
index 80d6bbd9b5..7835ef1a71 100644
--- a/include/ui/gtk.h
+++ b/include/ui/gtk.h
@@ -143,7 +143,6 @@ struct GtkDisplayState {
bool external_pause_update;
QemuClipboardPeer cbpeer;
- QemuClipboardInfo *cbinfo[QEMU_CLIPBOARD_SELECTION__COUNT];
uint32_t cbpending[QEMU_CLIPBOARD_SELECTION__COUNT];
GtkClipboard *gtkcb[QEMU_CLIPBOARD_SELECTION__COUNT];
bool cbowner[QEMU_CLIPBOARD_SELECTION__COUNT];