|
From: <tim...@en...> - 2006-02-03 17:53:44
|
Ethan Merritt wrote:
> I will explore setting XA_TIMESTAMP as an explicit target,
>
>but I am dubious that this will fix anything by itself.
>
>You later quote the following with regard to TIMESTAMP:
> "Clients should not set the time value to CurrentTime"
>As you point out, we are using CurrentTime in gnuplot_x11.
>
>It is hard for me to understand what sense it makes to call
>something a "timestamp" if it does not, in fact, contain the
>current time.
>
>However,....
>I don't think this is the problem. The failure mode described in
>the section you quote is that the client [gnuplot_x11 in this case]
>may not properly obtain ownership. That is not what I see happening.
>We gain ownership just fine. The problem is that if we do not
>explicitly *relinquish* ownership, then klipper keeps sending
>its requests over and over again. I think this cannot be correct
>behaviour by klipper. It should request once, and only [maybe]
>request again if the first request fails.
> =20
>
Indeed, it may not be the problem.
>Meanwhile, I have updated gplt_x11.c in CVS to separately request
>export of either the mouse coordinate string or the pixmap+colormap,
>but not both at the same time. This seems to make klipper happier,
>since it now notices the the string export whereas before it did not.
>However, I still find it necessary to explicitly remove gnuplot_x11 from
>the selection list after replying once; otherwise klipper loops
>ad nauseum.
> =20
>
I've just checked current CVS. Results : mouse coordinate appear in
PRIMARY, so that they can be pasted with the third mouse button, and
they appear in klipper. That's good.
The plot graph appears in klipper, but I can't paste it anyway but after
selecting it in klipper. If I don't select it in klipper, or if klipper
is not launched, I have nothing at all to paste ! I've tried with both
kde apps (KolourPaint) and non-kde (Gimp). I'm not sure this is the
expected behaviour ;-)
That's probably because you "remove gnuplot_x11 from the selection
list". As far as I understand, the app is intended to keep the ownership
of the clipboard as long as it provides something in it.
>Update:
>A very quick test indicates that even if I set XA_TIMESTAMP as a target,
>klipper never requests it. So I think that diagnosis is wrong. I=20
>tried:
>
>static Atom targets[] =3D { XA_PIXMAP, XA_COLORMAP, XA_TIMESTAMP };
>...
>XChangeProperty(dpy, reply.xselection.requestor,
> reply.xselection.property,
> reply.xselection.target,
> 32, PropModeReplace, targets, 3);
>...
> } else if (reply.xselection.target =3D=3D XA_TIMESTAMP) {
> fprintf(stderr, "TIMESTAMP request\n");
>
>The fprintf never triggers.
>Maybe I've done something wrong, but that code fragment is exactly
>parallel to the XA_PIXMAP and XA_STRING target code that is already
>working.
> =20
>
I tried myself, and got it working with the attached diff (against cvs
before your patches).
Basically, I used :
XA_TIMESTAMP =3D XInternAtom(dpy, "TIMESTAMP", False);
and :
... } else if (reply.xselection.target =3D=3D XA_TIMESTAMP) {
FPRINTF((stderr, "timestamp request from %d : %ld\n",
reply.xselection.requestor, export_time));
XChangeProperty(dpy, reply.xselection.requestor,
reply.xselection.property, reply.xselection.target,
32, PropModeReplace, (unsigned char *) &(export_time), 1)=
;
...
When klipper is launched, the fprintf is regularly triggered, and the
pixmap/colormap cases are just triggered once ! The loop is on the
timestamp case, which was the expected bahaviour according to the docs
in the previous mail.
There's one (small) problem that I don't understand : the first graph
(when it is first plotted) appears twice in klipper, and the
pixmap/colormap cases are triggered twice for this first time.
Hope that will help.
Timoth=E9e
|