|
From: Daniel J S. <dan...@ie...> - 2006-07-15 04:15:29
|
Ethan Merritt wrote:
> On Friday 14 July 2006 03:23 pm, Daniel J Sebald wrote:
>
>>I'm not an X-pert (the usual disclaimer), but I believe there is
>>indeed some confusion here, and I think it is with the phrase
>>"clipboard". From what I'm seeing in the code, this feature of being
>>able to copy the X11 gnuplot image is not using the clipboard.
>
>
> It is.
Not according to the little tests I've done here... OK, same scenario, generating X11 plots in gnuplot, wanting to get those images over to OpenWriter.
To dump stuff into the clipboard, instead of
export_graph(struct plot_struct *plot)
inside gplt_x11.c attempting to become owner of PRIMARY, I instructed it to attempt becoming owner of CLIPBOARD:
static void
export_graph(struct plot_struct *plot)
{
static Atom XA_CLIPBOARD = (Atom) 0;
if (XA_CLIPBOARD == 0)
XA_CLIPBOARD = XInternAtom(dpy, "CLIPBOARD", False);
XSetSelectionOwner(dpy, XA_CLIPBOARD, plot->window, CurrentTime);
}
And, as per documentation which indicated to be ready as soon as sending that command to get back an event, I've seen the event come without any outside client requesting.
CLIPBOARD = 368
Hit return to continueselection request target: TARGETS (324)
And there is a lot of these. Whenever I click in an editing type of applications, X immediately issues:
selection request target: TARGETS (324)
I then go over to OpenWriter and I can CNTRL-V paste the image into the application as often as I like:
<PASTE #1>
selection request target: MULTIPLE (325)
atom (null) 1852402734 : 1631860837
atom (null) 1936025715 : 0
selection request target: PIXMAP (20)
selection request target: COLORMAP (7)
<PASTE #2>
selection request target: TARGETS (324)
selection request target: MULTIPLE (325)
atom (null) 1852402734 : 1631860837
atom (null) 1936025715 : 0
selection request target: PIXMAP (20)
selection request target: COLORMAP (7)
<PASTE #3>
selection request target: TARGETS (324)
selection request target: MULTIPLE (325)
atom (null) 1852402734 : 1631860837
atom (null) 1936025715 : 0
selection request target: PIXMAP (20)
selection request target: COLORMAP (7)
I point out that once I exit gnuplot and the X11 window goes away, CNTRL-V pasting will no longer work. However, the CNTRL-V still works in clipboard fashion if I go to some other app and use the center mouse button to highlight text.
To me, that is proper clipboard operation. So, gnuplot is currently using Primary selection, not Clipboard.
Ethan, I think we can fix this to be more like conventional X applications. Should we give it a try before 4.2?
I'd propose to the list that there be a Primary selection, via mouse and CNTRL sequences, for both the gnuplot image and the text feature that Petr mentioned currently exists. The CUT/PASTE should then be enabled as well. When the image becomes the primary selection, we should contrast it in blue somehow, the way other apps do.
Thoughts?
Dan
|