|
From: Ethan M. <merritt@u.washington.edu> - 2009-02-07 00:59:14
|
On Friday 06 February 2009 15:45:20 Petr Mikulik wrote:
> > On Friday 06 February 2009 13:57:41 Petr Mikulik wrote:
> > > > The intent is to update GPVAL_TERM_WINDOWID when the main program receives a
> > > > "new window" event from gnuplot_x11, right?
> > > >
> > > > I am trying to point out that not every command "set term x11 <num>" creates
> > > > a new window. If an old window is re-used, you won't receive this event and
> > > > therefore GPVAL_TERM_WINDOWID will not be updated.
> > > >
> > > > The patch currently has the event generated each time the buffered command
> > > > list is re-executed, which I think is not right. Probably it should go in
> > > > pr_window(), immediately after the call to XCreateWindow().
> > >
> > > When I tested it, it was filling the variable after the "plot" command has
> > > been completed (not after "set term x11"), i.e. after the graph has been
> > > drawn.
> >
> > I think the correct patch on the gplt_x11.c end is something like the one
> > attached here.
>
> Fine, it send the ID; however, it does not resend the current one after
> change of the active window:
That's exactly what I've been trying to point out all along!
Glad we agree :-)
> gnuplot> set term x11 1; test; print sprintf("%x", GPVAL_X11_WINDOWID)
> gplt_x11.c:5918: SENDING NEW WINDOWID 0x540008a TO GNUPLOT...
> 540008a
> gnuplot> set term x11 2; test; print sprintf("%x", GPVAL_X11_WINDOWID)
> gplt_x11.c:5918: SENDING NEW WINDOWID 0x54000a6 TO GNUPLOT...
> 54000a6
> gnuplot> set term x11 1; test; print sprintf("%x", GPVAL_X11_WINDOWID)
> 54000a6
>
> ---
> PM
>
--
Ethan A Merritt
|