|
From: Petr M. <mi...@ph...> - 2009-02-13 23:12:36
|
> >> unless user explicitly changes these values via > >> set(gcf, 'position', [new values]) > >> I propose you add a static variable which remembers last 'position' values > >> and does "set term ... size position" only in case of a change. I think this > >> is a useful compromise. I propose the following solution to this case: gnuplot: - I will commit the patch to define GPVAL_TERM_WINDOWID. Octave: - It will use "set term ..." without "size and position" by default. - It will have a flag to see whether user has changed (gcf, 'position') explicitly; only in this case, it will use "set term .. size position". - If user wants get(gcf), then Octave will find the current values by: 1a. launch new gnuplot instance with set term x11 position 100,100 size 100,100 1b. by means of GPVAL_TERM_WINDOWID and xwininfo, get the current value of position => these are the correction factors with respect to the above 100,100 1c. close this dummy gnuplot session 2. get xwininfo from the gcf's session and correct it by the above factors Note that 1. can be done once only. Note this will work on X11 only. More portable way is that terminals report some GPVAL_ variables about their position on the desktop, but it would just increase the piping traffic and I doubt it's worth the effort. --- PM |