Bug#230821: [Gcm-devel] Bug#230821: patch looks ok

Bill Spitzak Bill Spitzak <spitzak@d2.com>, 230821@bugs.debian.org
Thu, 25 Mar 2004 17:19:27 -0800


On Wednesday 24 March 2004 02:48 pm, Philip Van Hoof wrote:
> Added to CC: Bill Spitzak, responsible for the Clipboard specification
> on freedesktop.org

Actually all I did was cut & paste their previous document to turn it into a 
wiki page. However I am very interested in this. Best idea I have for fixing 
the clipboard is to have the clipboard owner responsible for doing something 
before it exits (it is probably ok if the clipboard is lost if the program 
crashes). Something like this:

1. Clipboard program creates a window and sets a SELECTIONS property on the 
root window. This is a set of pairs of atoms naming selections and window 
id's. Typically only PRIMARY and CLIPBOARD are there, and only CLIPBOARD has 
a window id.

2. When a program exits or otherwise destroys the window owning a selection, 
it examines this property and finds the selection. If it is there and the 
window is non-zero and exists, it sets properties on that window:

3. TARGETS to the list of possible data forms (this can be smaller than the 
set it responds to SelectionRequest with, so expensive data types are 
skipped).

4. For each value in TARGETS, it sets a property by that name to the data.

5. It then does XSetSelectionOwner to that window (if in fact this can be 
done and it causes the program owning that window to get an event. If not it 
will have to send an event, but that is going to result in race conditions...)

-- 
                   ,~,~,~,~ ~ ~ ~ ~
     /\_       _|_========___         Bill Spitzak
 ~~~/\/\\~~~~~~\____________/~~~~~~~~ spitzak@d2.com