|
From: Petr M. <mi...@ph...> - 2009-02-07 17:51:43
|
> > > > > > 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:
> >
> > > 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
> >
> > That's exactly what I've been trying to point out all along!
> > Glad we agree :-)
>
> I'm not so sure whether you also think it is a bug to be fixed, because the
> ID needs to be sent after each new activation, i.e.
>
> set term x11 1
> plot sth ---> now send the ID
> plot sth ... no need to send the ID
> plot sth ... no need to send the ID
> plot sth ... no need to send the ID
>
> set term x11 2
> plot sth ---> now send the ID
> plot sth ... no need to send the ID
> plot sth ... no need to send the ID
>
> set term x11 1
> plot sth ---> now send the ID
> plot sth ... no need to send the ID
> plot sth ... no need to send the ID
>
> and your patch does not do that.
It seems that the ID has to be really sent after "set term x11 + plot":
gnuplot> set term x11 1; plot x; system('xwininfo | grep -w id')
Terminal type set to 'x11'
Options are '1 nopersist'
xwininfo: Window id: 0x5e0008a "Gnuplot 1"
gnuplot> set term x11 2; plot x*x; system('xwininfo | grep -w id')
Terminal type set to 'x11'
Options are '2 nopersist'
xwininfo: Window id: 0x5e000a3 "Gnuplot 2"
gnuplot> !killall gnuplot_x11
!
gnuplot> set term x11 2; plot x*x; system('xwininfo | grep -w id')
Terminal type set to 'x11'
Options are '2 nopersist'
xwininfo: Window id: 0x5e0008a "Gnuplot"
---
PM
|