octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #52698] Clicking on plot window menu or window


From: Marshall
Subject: [Octave-bug-tracker] [bug #52698] Clicking on plot window menu or window decoration does not make figure current
Date: Wed, 20 Dec 2017 13:59:10 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0

Follow-up Comment #5, bug #52698 (project octave):

The patch works for me for what I wanted. 

I don't really care if the figure gains focus when clicking on the title bar,
etc. Actually, I think I like that there is a way to rearrange figures
manually without changing which has focus for the next plotting commands. I've
had to do very careful use of passing axis/figure/plot handles to each
plotting/animation function to avoid plotting in the wrong windows/axes,
especially when doing long animations: I don't like the animation jumping to
another axis (and overwriting that plot) when all I want is to rearrange
windows to see more things at once, or to move things to better positions.

For example:

close all
figure(1)
figure(2)
figure(1)
while true
  plot(rand(10));
  drawnow;
endwhile

The second figure will block the first one, which has an animation running on
it, but I want to move the second to watch it. Moving and resizing it
shouldn't change the focus. But click on the axis of figure(2), and now it
will begin the animation there. Rather annoying actually, especially if
figure(2) had taken a while to process and draw that data. Stray clicks can
ruin good plots. 

For what it's worth the following avoids the problem, but it takes more lines
of code and I don't always write it this way the first time through a
script/function, and don't do it this way until drawing in the wrong axis has
bitten me too many times or too hard, or if I need faster animations. 

close all
figure(1)
p = plot(rand(10));
figure(2)
figure(1)
while true
  for i=1:10
    set(p(i),'ydata',rand(1,10));
  endfor
  drawnow;
endwhile


I note that 4.2.1 doesn't have this problem at all with this test. In matlab
this problem presents itself in almost the same way except that in the above,
figure(1) brings the figure window to the front (octave doesn't), so there is
less temptation to rearrange windows in this example. In Matlab I can't even
move the windows without changing the focus and starting the animation running
on the other figure, which would be the result if full figure focus was taken
by clicking on titlebar or decorations. I'd accept if the behavior was
implemented because matlab does it that way and I already have workarounds
(from when I worked a lot in matlab), but I don't prefer that behavior.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?52698>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]