Implement clipboard manager

Merged Carlos Garnacho requested to merge wip/carlosg/clipboard-manager into master

This branch gets a few things going:

  • Generic API has been added for selections, with implementations in src/x11 and src/wayland. It's now all based on GInputStream/GOutputStream, so transfers between different selection types are generic on the high level.
  • Now that src/wayland/meta-xwayland-selection.c got a bunch of its responsibilities taken away, it could be simplified so that it just handles DnD messaging.
  • A simple memory based selection source was added, and a clipboard manager implementation on top of it. The implementation is somewhat simple and the x11 side of it doesn't quite follow (it simply inspects the clipboard after every owner change), but it may work on both x11 and wayland. Just text is stored, which covers 99% of the usecases.
  • Part of the API was made public, so that StClipboard could be ditched or reimplemented on top. (one less fixed x11 usage \o/)

This also could allow simplifying meta-wayland-data-device.c, as MetaWaylandDataSource is more for DnD. I plan to split the DnD bits into a separate object, which clipboard/primary don't strictly require, but I stopped shy of doing that (rather, got a mess in my stash :).

This also takes over gsd-clipboard functionality and allows to simply remove it.

Merge request reports