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.

Submitter:  None
Submitted:  Tue 28 Mar 2017 07:17:53 PM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Bor Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 4.2.1
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

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

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

Rik <rik5>
Group 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>
Group 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>
Group 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>
Group 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>
Group 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:


close all;
h1 = figure (20);
h2 = figure (21);
gcf
## Now Use mouse to select figure 20
gcf


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,


figure (20)



Rik <rik5>
Group 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 Files:
   
   
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
  • -email is unavailable- added by pantxo (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-04-07 rik5 StatusIn Progress Fixed
        Open/ClosedOpen Closed
    2017-04-06 pantxo StatusConfirmed In Progress
    2017-04-06 rik5 Releasedev 4.2.1
    2017-03-31 pantxo Attached File- Added mouse_currentfig.patch, #40221
    2017-03-31 pantxo CategoryGUI Plotting with OpenGL
        Release4.2.1 dev
    2017-03-28 rik5 StatusNone Confirmed
        Operating SystemMicrosoft Windows Any

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code