New clipboard proposal
Lubos Lunak
l.lunak at suse.cz
Sat Jan 1 15:55:59 EET 2005
Dne čt 30. prosince 2004 20:21 Philip Van Hoof napsal(a):
> Hi there fellow hackers, programmers and other people involved in the
> development of the freedesktop.
>
> There's been many problems with the current implementation of the X11
> clipboard. Before I start with my new proposal I'll guide you through
> the current implementation so you'll understand some terminology. If you
> already know everything about the clipboard on X11, you can skip all
> this, of course.
...
>
> There's many problems with this method:
>
> o. What happens when Mozilla got shut down before Evolution got
> the chance to paste the clipboard?
>
> o. What happens when Mozilla has 400MB of data to deliver? A better
> example might be "copying a large table from
> gnumeric to Mozilla composer"
>
> o. What happens when you shutdown your X session. Is your
> clipboard lost?
>
> To address these issues, I've cooked up a proposal. The proposal aims to
> replace the entire clipboard in the long run. But will provide full
> backwards compatibility for older X-clients. The proposal won't depends
> on any technology disliked by both KDE or GNOME.
>
> The proposal itself is incomplete. There's still a lot to agree upon.
>
> The proposal
>
> o. We'll still use the current protocol for advertising the fact
> that there's support for the new-type clipboard. There's no problem
> with still using the old-style clipboard.
>
> o. We add a TARGET "x-extension/dbus"
>
> o. The contents of the target explane the available
> services on dbus. The format of the contents isn't
> defined yet.
>
> o. We'll create a library that will do most for the application
> developer
I see two ways of interpreting this:
a) keep things the way they currently are, only use DBUS for large data
transfers
b) build a completely separate clipboard mechanism, only use X for announcing
it (in which case I think any dependency on X doesn't make sense if you don't
want to really use X anyway)
Which of these two possibilities is the one you have in mind?
>
> o. That library will initiate dbus in such a way that both
> xclients/processes can enjoy the wonders of inter process
> communication. This will address the "large clipboards" issue.
Here I'd just like to mention that the INCR transfers can use very large data
chunks, so I don't think there's any "large clipboards" issue in the most
common case. It might make sense in case the two clients are on the same host
and X is remote though.
>
> o. The library will fallback to the oldstyle X11 protocol if the
> dbus connection failed. This way it isn't necessary to let
> dbus serve on tcp/ip or to open ports. If both processes
> aren't on the same host, it will use the current (working)
> implementation.
>
> o. A clipboard manager will, using the new Xfixes extensions,
> catch clipboards that will be lost if the selection-owner
> gets destroyed. That same clipboard manager will persist
> the clipboard when the session is about to get shutdown.
>
> o. Whether or not to support a clipboard history is an option or a
> plugin for that clipboard manager.
These two points are nothing new.
>
> o. The clipboard manager can also function as a hybride between
> old X11 applications and newer applications. The clipboard
> manager can, for example, add the "x-extension/dbus" target and can
> provide a service that will deliver the data if a newer application
> wants to receive the data using that channel.
>
> I attached two dia diagrams. You can view them using the app "dia" which
> is available here: http://dia.sf.net. They might be incomplete or
> inaccurate or whatever. And no there's not really anything done yet
> (except a very basic sample application using the new XFixes events
> related to clipboard handling).
--
Lubos Lunak
KDE Developer
More information about the xdg
mailing list