Re: XForms: X Selections & xforms

Dr. T.C. Zhao (zhao@bragg.phys.uwm.edu)
Sun, 17 Aug 1997 13:18:34 -0500

To subscribers of the xforms list from "Dr. T.C. Zhao" <zhao@bragg.phys.uwm.edu> :

from "Robert S. Mallozzi" <mallors@crazyhorse.msfc.nasa.gov> :

> You will see that xforms does not copy data to CLIPBOARD, but
>rather to XA_PRIMARY.

To me, a clipboard is or can be viewed as something that different
applications use to transfer data, not something that is
named CLIPBOARD no one uses. No practical applications (xterm and its
derivatives, which pretty is the entire CLI of X,
netscape and you name it) actually uses CLIPBOARD. So anything written
specically for CLIPBOARD actually will not be able to exchange
data with other applicaitons.

If you're only interested in exchange data from one part of your program
to other parts, which your code appears to do (not handling
the possibility of some other application wants the CLIPBOARD)
I am not sure if selection is the most efficeint thing to to use.

>In clipboard.c, you make the call
> XSetSelectionOwner(fl_display, XA_PRIMARY, win, CurrentTime);
> because of race conditions that can otherwise occur."

You're absolutely correct. Actual server time instead of
CurrentTime should be used. This is the reason for the comment
in the clipboard.c header that fl_clipboard violates the ICCCM.
This will be fixed (the risk of a race condition is practically
zero however).

>Also, I noticed that in the fl_stuff_clipboard call(), one is *required* to
>provide an FL_LOSE_SELECTION_CB callback, even if there is nothing to be done

I can relax this so a null functin ptr can be used.

Thanks for the code. I will try accomadate other selection
atoms in the next release.

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/