bugGNU Octave - Bugs: bug #54678, Figure's Position when MenuBar is...

 
 

bug #54678: Figure's Position when MenuBar is none

Submitter:  Guillaume <gyom>
Submitted:  Tue 18 Sep 2018 10:29:54 AM UTC
   
 
Category:  Plotting with OpenGL Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Fixed Assigned to:  None
Originator Name:  Guillaume Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 19 Sep 2018 11:41:58 AM UTC, comment #6: 

Thanks again Pantxo, works great!

Guillaume <gyom>
Wed 19 Sep 2018 11:01:17 AM UTC, comment #5: 

I pushed the updated patch here:

http://hg.savannah.gnu.org/hgweb/octave/rev/6109f302cf43

Closing report as fixed.

Pantxo Diribarne <pantxo>
Group Member
Wed 19 Sep 2018 10:38:19 AM UTC, comment #4: 

Thanks for testing Guillaume. Looks like I did not attach the latest version of the patch. Anyway, I will cleanup the patch and push it soon.

Pantxo Diribarne <pantxo>
Group Member
Wed 19 Sep 2018 08:52:01 AM UTC, comment #3: 

Thanks @Pantxo!

When I first applied the patch, I got an error at compilation:


  CXX      libgui/graphics/libgui_graphics_libgui_graphics_la-ObjectFactory.lo
../libgui/graphics/Figure.cc:544:52: error: no ‘void QtHandles::Figure::showMenuBar(bool, int)’ member function declared in class ‘QtHandles::Figure’
   Figure::showMenuBar (bool visible, int h_previous)


I then removed the following from Figure.cc:


  void
  Figure::showMenuBar (bool visible, int h_previous)
  {
  }


and it compiled fine. With the patch, the issue I mentioned disappear and everything seem to be working fine! Thanks!

Guillaume <gyom>
Tue 18 Sep 2018 08:00:08 PM UTC, comment #2: 

@Guillaume: I attached a patch that fixes the original issue for me (and simplifies the "menubar" property handling). Can you test it?

(file #45041)

Pantxo Diribarne <pantxo>
Group Member
Tue 18 Sep 2018 02:48:20 PM UTC, comment #1: 

Confirmed, looks like I did not check this case ... I'll look into this.

The workaround for the time being is to change the "menubar" property after the figure has been constructed.


hf = figure ("position", [650 350 620 500]);
set (hf, "menubar", "none");


Pantxo Diribarne <pantxo>
Group Member
Tue 18 Sep 2018 10:29:54 AM UTC, original submission:  

Since recently in dev (since 25878:bb4af245dff7 perhaps), the size of a figure is not correct when MenuBar is disabled. Running the following:


F = figure ('Position',[650 350 620 500], 'MenuBar','figure');
get (F, 'Position')

F = figure ('Position',[650 350 620 500], 'MenuBar','none');
get (F, 'Position')


displays a second figure smaller in height (the drawable area):


octave:1> F = figure ('Position',[650 350 620 500], 'MenuBar','figure');
octave:2> get (F, 'Position')
ans =
   650   350   620   500
octave:3>
octave:3> F = figure ('Position',[650 350 620 500], 'MenuBar','none');
octave:4> get (F, 'Position')
ans =
   650   350   620   500
octave:5>
octave:5> get (F, 'Position') # asking again manually
ans =
   650   350   620   410


While physically smaller, the returned Position of the second figure is the asked one. If one then asks for the Position again, the return position now differs and seem to correspond to the one actually used. The drawable area seems to have the asked Position minus the size of all of the menus (top and bottom).

Guillaume <gyom>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45041:  uimenus3.patch added by pantxo (8KiB - 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 gyom (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-09-19 pantxo StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2018-09-18 pantxo Attached File- Added uimenus3.patch, #45041
        StatusConfirmed Patch Submitted
    2018-09-18 pantxo CategoryPlotting Plotting with OpenGL
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.14-0608.
    Corresponding source code