|
From: Petr M. <mi...@ph...> - 2009-02-11 15:08:48
|
On Fri, 6 Feb 2009, Ethan Merritt 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. I have updated the patch [ 2570385 ] GPVAL_X11_WINDOWID https://sourceforge.net/tracker/?func=detail&atid=302055&aid=2570385&group_id=2055 with Ethan's solution and an additional wrapper over GE_plotdone sender. Now, only changed window ID's are sent to gnuplot for the variable GPVAL_TERM_WINDOWID to be updated. Ben, can you please test it? Would it suite the needs in Octave? BTW, I've tested the freshly released octave-3.1.52 and I'm disappointed about the plotting window behaviour. Gnuplot graph window gets always closed and reopened, but not at the previous position, but at some default position. Moreover, it hijacks the focus. Hitting the "space" hotkey helps to go back, however, is this behaviour really desired? Octave is executing set term x11 close size nnn,nnn position nnn,nnn I think the repositioning command should be issued only if user has explicitly changed it. Do I have to recompile Octave in order to get rid of this behaviour, or is there some magic "set(gca)" to put the window to the screen corner? --- PM |