enthought / mayavi

3D visualization of scientific data in Python
http://docs.enthought.com/mayavi/mayavi/
Other
1.32k stars 285 forks source link

Editor window doesn't remember size under Qt #809

Open corranwebster opened 5 years ago

corranwebster commented 5 years ago

To replicate (via Prabhu):

mayavi2 -d ParametricSurface -m Surface

then in the view make sure that the pipeline view, object editor and python shell are turned on. then adjust the view and close the app. if you re-launch with

$ mayavi2 -d ParametricSurface -m Surface

you should see the issue with the app not retaining the size for the VTK view.

With a bit of digging, I think at least part of the problem is that the default EditorManager (and the default Envisage WorkbenchEditorManager) do not implement the get_editor_memento and set_editor_memento methods. This means that although the geometry of the editor area is serialized, when loading there is no way of restoring the individual editor tabs and so an empty editor area is created (see https://github.com/enthought/pyface/blob/e047d8b882f2d2f52b4a4a8e7c6af86be2489143/pyface/ui/qt4/workbench/split_tab_widget.py#L110 for the restoration code).

There may be more going on - for example something should be storing the geometry of the central widget of the MainWindow and if this is not done by the saveState/restoreState of the QMainWindow then this is something that Pyface would need to track separately.

And it is also not clear if this is a Pyface issue for not doing something sensible if it can't restore tabs, or a Mayavi issue.

In any case, the correct fix is probably to migrate Mayavi to Tasks.

prabhuramachandran commented 5 years ago

Thanks! Migrating to tasks is on the cards but will likely be quite a bit of work.