Clipboard management
Matthias Clasen
mclasen at redhat.com
Fri Apr 30 17:14:45 EEST 2004
On Fri, 2004-04-30 at 09:00, Lubos Lunak wrote:
> On Wednesday 28 of April 2004 21:16, Matthias Clasen wrote:
> > In order to move forward with solving the clipboard problems, here is a
> > proposal to codify the existing practice of using the CLIPBOARD_MANAGER
> > selection to ensure mutual exclusion for clipboard managers. This
> > manager selection already is supported by the classic xclipboard client,
> > the Motif clipboard manager and gcm. I don't know if Klipper uses it
> > currently.
>
> No, it doesn't, but there's no problem adding it. Is just owning the
> selection enough, or are there some other requirements? I can't find any
> documentation on it, other than
> http://www.faqs.org/faqs/motif-faq/part9/section-21.html , I don't see
> anything about it in the ICCCM, despite the Motif FAQ saying so.
No requirements beyond those which apply to all manager selections. It
seems that the "traditional" clipboard managers use the selection merely
for mutual exclusion.
> Note also that Klipper works differently than how the Motif FAQ says, it does
> not claim CLIPBOARD ownership unless there's no other owner, but I guess
> that's not really important.
No. I'm proposing the side effect target below specifically to allow
writing a clipboard manager which only takes ownership of the clipboard
if asked to do so...
> >
> > Clipboard Manager Specification
> > ===============================
> >
> > Responsibilities of clipboard managers
> > --------------------------------------
> >
> > Clipboard managers will acquire ownership of a selection named
> > CLIPBOARD_MANAGER, as described in section 1.2.6 of the ICCCM. Clipboard
>
> The reference to 1.2.6 is unnecessary and IMHO just confusing. There will be
> just one selection, so there's no need for discriminated names.
The reference should probably be to section 2.8 which describes the
general requirements for manager selections.
>
> > Clipboard managers should support conversion of the SAVE_TARGETS target
> > on their manager selection. This is a side-effect target, as described
> > in ICCCM section 2.6.3.
> >
> > When a clipboard manager receives a request to convert the manager
> > selection to the target SAVE_TARGETS, the named property specifies a
> > list of targets to convert the CLIPBOARD selection to. If the named
> > property exists, it must be of type ATOM and contain the list of
> > targets. If the named property does not exist, the list of targets
> > should be obtained by converting the CLIPBOARD to the TARGETS target.
>
> I think I have some trouble decriphering what this says. Could you please
> explain this once again in normal human speech?
Ok, so the idea is that if a CLIPBOARD owner is about to exit, it
requests to convert the CLIPBOARD_MANAGER to SAVE_TARGETS. The side
effect of the conversion is that the clipboard manager collects the
contents of the CLIPBOARD, takes over the ownership of the clipboard and
offers the same content. For additional flexibility, the dying clipboard
owner has a way to specify what targets the clipboard manager should
harvest, by specifying the list of targets to harvest in the property
named in the conversion request.
Basically, SAVE_TARGETS is a way for the clipboard owner to say to the
clipboard manager "I'm about to exit, take over the my clipboard
contents and the clipboard ownership".
Matthias
More information about the xdg
mailing list