bugGNU Octave - Bugs: bug #50666, gcf always returns 1 unless figure...

 
 

bug #50666: gcf always returns 1 unless figure is selected with call to figure.

Submitted by:  None
Submitted on:  Tue 28 Mar 2017 07:17:53 PM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: BorOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.2.1
Operating 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 06 Apr 2017 09:51:43 PM UTC, comment #7:

Done: http://hg.savannah.gnu.org/hgweb/octave/rev/43f549ac6dac

Pantxo Diribarne <pantxo>
Project Member
Thu 06 Apr 2017 09:19:15 PM UTC, comment #6:

Ping! Pantxo, go ahead and commit your patch to stable.

Rik <rik5>
Project Administrator
Mon 03 Apr 2017 03:51:58 PM UTC, comment #5:

@Pantxo: I checked your patch and it is a definite improvement. As with FLTK, one is still required to click in the Canvas area of the figure in order for the gcf to be updated.

It seems like the long term fix should be some listener on the window itself so that clicks on the window frame, or the menus, or the toolbar actually work.

However, I'll take this fix. I think you should commit it to stable since 4.2.1 has this problem as well.

Rik <rik5>
Project Administrator
Fri 31 Mar 2017 01:54:08 PM UTC, comment #4:

In fact it is a matter of overloading the QWidget::mousePressEvent function.

I have a tentative patch (attached) that does this for the Canvas, but it only works when clicking on the drawing area.

(file #40221)

Pantxo Diribarne <pantxo>
Project Member
Fri 31 Mar 2017 01:24:31 PM UTC, comment #3:

That probably means that when the window manager informs the windowing system Qt that a different plot has been selected, we are not catching tha signal and updating the root (0) figure's "CurrentFigure" property.

Rik <rik5>
Project Administrator
Fri 31 Mar 2017 12:11:58 PM UTC, comment #2:

Just a note: works perfectly well with fltk, only Qt toolkit is affected.

Pantxo Diribarne <pantxo>
Project Member
Tue 28 Mar 2017 08:42:07 PM UTC, comment #1:

Confirmed. And it also affects Linux systems (tested with dev branch).

Code to reproduce:

It is a poor workaround, but you can switch figures from the command window by using the figure() command and the figure number as the input. For example,

Rik <rik5>
Project Administrator
Tue 28 Mar 2017 07:17:53 PM UTC, original submission:

OS: Windows 10 Pro 64bit

Expected:

gcf should return fig number of current figure selected with call to figure or with mouse click.

Current result:

Mouse click does not alter result of gcf.

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #40221:  mouse_currentfig.patch added by pantxo (924B - 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 (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (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
    Fri 07 Apr 2017 05:04:17 PM UTCrik5StatusIn Progress=>Fixed
      Open/ClosedOpen=>Closed
    Thu 06 Apr 2017 09:51:43 PM UTCpantxoStatusConfirmed=>In Progress
    Thu 06 Apr 2017 09:19:15 PM UTCrik5Releasedev=>4.2.1
    Fri 31 Mar 2017 01:54:08 PM UTCpantxoAttached File-=>Added mouse_currentfig.patch, #40221
    Fri 31 Mar 2017 12:11:58 PM UTCpantxoCategoryGUI=>Plotting with OpenGL
      Release4.2.1=>dev
    Tue 28 Mar 2017 08:42:07 PM UTCrik5StatusNone=>Confirmed
      Operating SystemMicrosoft Windows=>Any

    Back to the top


    Powered by Savane 3.1-cleanup1