bugGNU Octave - Bugs: bug #52698, Clicking on plot window menu or...

 
 

bug #52698: Clicking on plot window menu or window decoration does not make figure current

Submitted by:  Marshall <marsian>
Submitted on:  Tue 19 Dec 2017 08:58:04 PM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: MarsianOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Thu 21 Dec 2017 01:10:04 PM UTC, comment #7:

I looked into having any click in a Qt figure make it current:

  • the attached cset is enough to have the figure become the currentfigure if one clicks the toolbar or menubar areas (including buttons).
  • the canvas area is already handled elsewhere.
  • clicking outside the above mentioned areas (e.g. title bar, corners or edges for resizing) does nothing. I don't know how to handle those cases (at least this thread [1] suggests it would involve platform dependent coding) in a ML compatible way. I don't know either if it is desirable since marsian's arguments against ML behavior are pretty sensible.

[1] https://forum.qt.io/topic/8922/solved-how-to-catch-mouse-click-event-on-titlebar-area-of-qmainwindow/7

(file #42695)

Pantxo Diribarne <pantxo>
Project Member
Thu 21 Dec 2017 01:01:54 AM UTC, comment #6:

I pushed Pantxo's fix here http://hg.savannah.gnu.org/hgweb/octave/rev/e7624c23b101. It would probably be good to document, at som point, how the mouse and the window figure interact to determine the current figure.

Rik <rik5>
Project Administrator
Wed 20 Dec 2017 06:59:10 PM UTC, comment #5:

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:
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.

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.

Marshall <marsian>
Wed 20 Dec 2017 05:52:09 PM UTC, comment #4:

@Pantxo: Your patch solves the immediate issue of closing figures. But it still leaves open the issue that clicking on a figure does not always make it the current figure.

Would it not be good to have comments in this potentially temporary patch to remind later coders that it should be removed when the GUI is fixed?

Rik <rik5>
Project Administrator
Wed 20 Dec 2017 09:15:56 AM UTC, comment #3:

I attached a patch to make use of the "close" function instead of directly executing the closerequestfcn.

(file #42690)

Pantxo Diribarne <pantxo>
Project Member
Tue 19 Dec 2017 09:24:52 PM UTC, comment #2:

Confirmed.

I changed the bug summary to reflect the true problem which is that clicking on a figure window does not make it the current figure.

For the Qt and fltk toolkits you must click within the Canvas (axes) area of the figure in order to make the figure current. Clicking in the menu area, or on the window decorations is not enough.

This behavior is present in 4.2.1, but doesn't cause an issue there.

Rik <rik5>
Project Administrator
Tue 19 Dec 2017 09:04:20 PM UTC, comment #1:

I think this is a problem with the Qt toolkit. Can try changing over to the fltk toolkit just to make sure?

Rik <rik5>
Project Administrator
Tue 19 Dec 2017 08:58:04 PM UTC, original submission:

In the new development version, only the current figure window is closed even though the close button is pressed on a different figure.

To reproduce, open several figure windows, drag them so you can see any but the top one.

Press the x on figure 3 to close it. Figure 4 will close. call figure(2), then press the x on figure 3, and figure 2 will close. Press the x on figure 1, figure 3 will close.

Marshall <marsian>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #42695:  click_gcf.patch added by pantxo (1KiB - text/x-patch)
file #42690:  close_gui_fig.patch added by pantxo (2KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by pantxo (Updated the item)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by marsian (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 21 Dec 2017 01:10:04 PM UTCpantxoAttached File-=>Added click_gcf.patch, #42695
    Thu 21 Dec 2017 01:01:54 AM UTCrik5StatusPatch Submitted=>Fixed
      Open/ClosedOpen=>Closed
    Wed 20 Dec 2017 09:15:56 AM UTCpantxoAttached File-=>Added close_gui_fig.patch, #42690
      StatusConfirmed=>Patch Submitted
    Tue 19 Dec 2017 09:24:52 PM UTCrik5StatusNone=>Confirmed
      Operating SystemMicrosoft Windows=>Any
      SummaryOnly the current figure window is closed=>Clicking on plot window menu or window decoration does not make figure current
    Tue 19 Dec 2017 09:04:20 PM UTCrik5CategoryGUI=>Plotting with OpenGL

    Back to the top


    Powered by Savane 3.1-cleanup1