diff options
-rw-r--r-- | TODO | 1 | ||||
-rw-r--r-- | vdagent-x11.c | 13 | ||||
-rw-r--r-- | vdagent-x11.h | 1 | ||||
-rw-r--r-- | vdagent.c | 3 |
4 files changed, 17 insertions, 1 deletions
@@ -17,7 +17,6 @@ agents whose unix domain socket has the same uid. Various things: -make uinput communication non blocking --copy and paste: add support for release command from client -patch xorg driver to allow adding "random" resolutions -make vdagent xorg client try to add "random" resolutions -fedora package diff --git a/vdagent-x11.c b/vdagent-x11.c index 7019f11..db9e9df 100644 --- a/vdagent-x11.c +++ b/vdagent-x11.c @@ -738,3 +738,16 @@ void vdagent_x11_clipboard_data(struct vdagent_x11 *x11, uint32_t type, XFlush(x11->display); vdagent_x11_send_selection_notify(x11, prop, 1); } + +void vdagent_x11_clipboard_release(struct vdagent_x11 *x11) +{ + if (x11->clipboard_owner != owner_client) { + fprintf(stderr, + "received clipboard release while not owning client clipboard\n"); + return; + } + + XSetSelectionOwner(x11->display, x11->clipboard_atom, None, CurrentTime); + XFlush(x11->display); + vdagent_x11_set_clipboard_owner(x11, owner_none); +} diff --git a/vdagent-x11.h b/vdagent-x11.h index 775036b..94ad8c5 100644 --- a/vdagent-x11.h +++ b/vdagent-x11.h @@ -41,5 +41,6 @@ void vdagent_x11_clipboard_grab(struct vdagent_x11 *x11, uint32_t *types, void vdagent_x11_clipboard_request(struct vdagent_x11 *x11, uint32_t type); void vdagent_x11_clipboard_data(struct vdagent_x11 *x11, uint32_t type, const uint8_t *data, uint32_t size); +void vdagent_x11_clipboard_release(struct vdagent_x11 *x11); #endif @@ -52,6 +52,9 @@ int daemon_read_complete(struct udscs_connection *conn, case VDAGENTD_CLIPBOARD_DATA: vdagent_x11_clipboard_data(x11, header->opaque, data, header->size); break; + case VDAGENTD_CLIPBOARD_RELEASE: + vdagent_x11_clipboard_release(x11); + break; default: if (verbose) fprintf(stderr, "Unknown message from vdagentd type: %d\n", |