wayland-rs 0.30 is a major API redesign. This commit ports
wl-clipboard-rs to use it. As a bonus, it fixes
https://github.com/YaLTeR/wl-clipboard-rs/issues/1: the tests are now
fully robust†. As an extra bonus, it adds several randomized
property-based tests.
Since this is a pretty major rewrite, I also took this opportunity to
move to a more standard rustfmt config (Block indent style, default max
width).
Resolves https://github.com/YaLTeR/wl-clipboard-rs/issues/36.
†: the tests can currently fail due to a race condition in wayland-rs,
which will be automatically fixed when
https://github.com/Smithay/wayland-rs/pull/632 is merged.
* Split binaries from the main crate. (Closes: issue#15)
The binaries is put in a new crate wl-clipboard-tools.
* Update .travis.yml
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
* Fix CR comments
* More CR fixes
* Some more CR fixes
* revert line
Co-authored-by: Mikael Hermansson <mike7b4@protonmail.com>
Co-authored-by: Ivan Molodetskikh <yalterz@gmail.com>
Things wl-clipboard-rs did past-fork were not async-signal-safe, which
means they were unsafe in multi-threaded programs. It also caused some
suprising behavior, like #6. In any case, forking is better left off to
the actual binaries, so this commit switches the background copying
support to use a regular thread and be more explicit.
We're switching to using a thread instead of forking, which means the
values passed to copy can outlive the copy call, so borrowed values
cannot be used.
The version we actually need is v2, as we only care about the
name event. Technically, even this is not completely correct,
as we can still use a v1 seat seat perfectly well as long as
we're not trying to find a seat with a specific name, but v2
is sufficiently old to be considered mandatory with reason.
v2 is also the version wl-clipboard requires, for the same
reason.
This also adds a unit test for accepting a v2 seat.
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com>