LookingGlass/client/displayservers/Wayland
Quantum 7f5f46c448 [client] wayland: offer all supported clipboard formats
This commit restructures the Wayland clipboard handling for host->VM.

Before, we select one clipboard format and buffers the data for it, to
be presented to spice when needed.

Now, we simply offer all clipboard formats supported, and only when spice
asks for the data do we actually read the wl_data_offer. The wl_data_offer
is kept around until a new offer is presented, the offer invalidated, or
when we lose keyboard focus. This is in accordance with the specification
for wl_data_device::selection, which states that:

> The data_offer is valid until a new data_offer or NULL is received or
> until the client loses keyboard focus. The client must destroy the
> previous selection data_offer, if any, upon receiving this event.

We still buffer the entire clipboard data into memory because we have no
knowledge of the clipboard data size in advance and cannot do incremental
transfers.

Furthermore, if the user performs drag-and-drop on our window, we may have
need to handle multiple wl_data_offer objects at the same time. Therefore,
instead of storing state on the global wlCb object, we instead allocate
memory and store it as user_data on the wl_data_offer. As a result, we also
handle drag-and-drop so that we can free the memory.
2021-06-06 12:20:42 +10:00
..
clipboard.c [client] wayland: offer all supported clipboard formats 2021-06-06 12:20:42 +10:00
CMakeLists.txt [client] cmake: support building with libdecor 2021-03-15 10:54:35 +11:00
cursor.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
gl.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
idle.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
input.c [client] wayland: offer all supported clipboard formats 2021-06-06 12:20:42 +10:00
output.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
poll.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
registry.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
shell_libdecor.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
shell_xdg.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
state.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
wayland.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
wayland.h [client] wayland: offer all supported clipboard formats 2021-06-06 12:20:42 +10:00
window.c [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00