Clipboard management

Matthias Clasen mclasen at redhat.com
Wed Apr 28 22:16:15 EEST 2004


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.

Beyond that, I propose to use a side effect target on the manager
selection to support handing over clipboard ownership when the clipboard
owner exits.


Matthias 


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
managers should comply with the conventions for "Manager Selections"
described in section 2.8 of the ICCCM. The intent is for clients to be
able to request a variety of information or services by issuing
conversion requests on this selection. 

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.

When handling SAVE_TARGETS, the clipboard manager should convert the
CLIPBOARD selection to all the targets specified by the named property.
Then it should take over ownership of the CLIPBOARD selection and offer
the saved conversion results under the same targets they were requested
with.


Responsibilities of clipboard owners
------------------------------------

If an application needs to exit while owning the CLIPBOARD selection,
they should request the clipboard manager to take over the ownership of
the clipboard, using the SAVE_TARGETS mechanism, unless the user
explicitly specified to discard the clipboard contents. If there is no
clipboard manager, or if the SAVE_TARGETS conversion fails, the
application should simply exit.







More information about the xdg mailing list