[UNDER CONSTRUCTION]


                             The Clipboard
                             =============



1.0 Introduction
================

To understand how the Clipboard works, you first need to understand the
ICCCM specification (currently at version 2 in R6; you can find a PostScript
version in docs/hardcopy/ICCCM).  Read through it, frequently referring to
O'Reilly Volume Zero (the protocol reference) and Volume Two (the Xlib
reference), about how selections should work, and how the CLIPBOARD
selection in particular should be used.  It will take you about a month
to fully understand how all this should work.  Come back when you're done.


2.0 Basics
==========

Oh, you're back.  Is your head swimming with visions of SelectionNotify,
SelectionClear, XGetSelectionOwner(), and other choice nuggets?  Have you
seen the beautiful fogginess of EventHandlers, struggled with the concepts
of Atoms, properties on windows, and format atoms?

Good.  You're ready for the first nugget of information about the M*tif
clipboard.

Forget everything you've learned, it doesn't apply in 90% of the cases.

There are two coexisting mechanisms in Motif; there's the Motif way, and
there's the X way.  Both work, but the differences are a little messy until
you understand what gets used, and when.  (talk about compliant apps like
xclipboard vs Motif applications here).  The mechanism uses selections, but
doesn't do so in the traditional sense.

There are two selections: the XA_MOTIF_CLIP_LOCK, and the XA_CLIPBOARD.

The XA_MOTIF_CLIP_LOCK selection is used to serialize access to the
CLIPBOARD selection between M*tif applications.  The XA_CLIPBOARD selection
is used to indicate which app just added data to the clipboard via a copy
(normal M*tif case), or the application that just cut or copied something
to the clipboard (X case).

Contrary to O'Reilly, the Motif clipboard does NOT store data that you
pass to XmClipboardCopy in the CLIPBOARD property of the window that you
passed in (section 18.5 or section 17.5, depending on the version of Volume
Six (or Six-A, respectively) that you're reading.  Instead, it's stored on
the root window itself.  Unless I've got the only version of Motif that
does this try using xprop on the root window after you've copied something
to the clipboard;  if you don't see something like _MOTIF_CLIP_ITEM_*,
let me know).  However, ICCCM compliant applications do.

