orbment
orbment copied to clipboard
Synchronize X11 clipboard with compositor clipboard.
Currently you can't copy between X11 and wayland views.
Gnome Mutter has clipboard synchronization now, see https://mail.gnome.org/archives/gnome-announce-list/2015-May/msg00030.html Maybe we can reuse this implementation here?
Here's the commit https://git.gnome.org/browse/mutter/commit/?id=4fc1811c15f0caf342aa7c87ee75366144bea5a8 And this is the bug report https://bugzilla.gnome.org/show_bug.cgi?id=738312
It makes heavy use of gtk+ and glib and it's still almost 1000 lines of code. This is scary stuff.
Yeah, I'm aware of these links. We probably don't want to pull in gdk and glib. Weston has this code too actually. But I'm still avoiding this as the X11 clipboard is really pita and easy to get wrong.
It might make sense to do libclipboard that abstracts all these crap away. I've always wanted cross-platform clipboard solution that doesn't just use system("xclip"), and supports the mime conversions. Though it's lots of boring code.
Hm, I guess one does only need something like libclipboard in case of downwards compatibility to Xorg clipboard, right? Is it possible to create a seperate application, which can be run as a daemon in the background, to provide clipboard synchronization? This app could open some kind of dummy Xorg client to access the clipboard content etc.
I was planning to do clipboard synchronization / history either as plugin or introduce protocol extension for daemon.
Weston's implementation: https://cgit.freedesktop.org/wayland/weston/tree/xwayland/selection.c
Some thoughts on subject by Martin Graesslin. Developper of KDE Window Manager and KDE Plasma Compositor: https://blog.martin-graesslin.com/blog/2016/07/synchronizing-the-x11-and-wayland-clipboard/
He cheat with Qt to speak with X11 clipboard but need to implement link between both, and this is interesting to know. I think ;)