|
From: Ben A. <bpa...@ma...> - 2009-02-11 18:16:03
|
On Wednesday, February 11, 2009, at 10:08AM, "Petr Mikulik" <mi...@ph...> wrote: >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? > Petr, The window closing is a compromise to permit the window to be repositioned by octave. If you have some idea how the window may be repositioned and resized by latter "set term x11 ..." commands, I'm all for it. Regarding your suggestion of executing "set term x11 close size nnn,nnn position nnn,nnn" only when the figure position is explicitly changed, I agree. However, the current backend support does not communicate this information (meaning the current backend doesn't know what was changed or why a redraw of the figure is needed). I have some ideas of how to do this, but it will take me a while to get around to that. In any event, I'd prefer that gnuplot allow an existing window be resized and/or repositioned. That would remove the need to "close" an existing window. Ben |