Commit Graph

15 Commits

Author SHA1 Message Date
Quantum
f5e68711d0 [client] wayland: handle wl_data_source.target action
There is no action to be taken by the Looking Glass client, but a
handler needs to exist as certain other Wayland clients chooses to
send this message for copy-paste operations despite the fact it's
supposed to be used for drag-and-drop negotiation.
2022-08-14 12:05:51 +10:00
Geoffrey McRae
952ebea2c5 [all] refresh copyright dates 2022-01-05 19:42:46 +11:00
Tudor Brindus
14ad83c6b8 [client] use variable-relative sizeof where possible 2021-08-16 16:22:55 +10:00
Quantum
579f998519 [client] all: replace assert with DEBUG_ASSERT 2021-08-14 12:19:07 +10:00
Quantum
51b9cd4e5a [all] copyright: use unicode copyright sign ©
This is done for consistency with the license strings in appstrings.c.
2021-08-04 21:16:35 +10:00
Quantum
6419279c3c [client] wayland/clipboard: prefer text/plain over text/html
When both text/plain and text/html are available, we should prefer the plain
text as we can't paste HTML.
2021-06-26 12:49:47 +10:00
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
Quantum
24d0aa0c18 [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
Quantum
75a9e38e3a [client] wayland: remove sync transfer for VM->host copies
Since we are using epoll, there is no longer any need to remove O_NONBLOCK
with fcntl, and the comment is also no longer relevant.
2021-06-02 22:22:59 +10:00
Quantum
000d91afca [client] wayland: prefer PNG over other image types
Support for non-PNG types is optional in the spice agent, so we should
avoid sending those if PNG is available.

Currently, the spice VDAgent supports only PNG and BMP formats.
2021-05-30 14:32:18 +10:00
Quantum
437bba1897 [client] wayland: update to support new spice clipboard type list 2021-05-30 12:39:00 +10:00
Quantum
854b53e28c [client] wayland: use consistent naming in poll module
Some of the functions were named WaylandEpoll*, which is inconsistent.
This commit changed them to be WaylandPoll*.
2021-03-03 16:38:23 +11:00
Tudor Brindus
484012a90c [client] wayland: bind no-op drag-and-drop handlers
Otherwise, libwayland aborts when a drag into the Looking Glass window
occurs.
2021-02-27 14:49:06 +11:00
Quantum
798a1aadb5 [client] wayland: fail gracefully when interfaces are too old
Before, we just attempt to bind, causing an obscure Wayland error.
This commit checks the interface versions and print better error
messages.
2021-02-26 09:43:38 +11:00
Quantum
5649d1ad95 [client] wayland: split Wayland display server into modules
The Wayland display server is getting unwieldy due to the sheer size.
To make it easier to edit in the future, I split it into many components
based on logical boundaries.
2021-02-21 10:31:49 +11:00