Mercurial > octave
changeset 25357:7aeafec2b102
keep editor hidden at next startup when it was hidden (bug #53830)
* file-editor.cc (check_closing): store visibility before removing tabs and
deleting the related widgets and restore visibility afterwards
author | Torsten <mttl@mailbox.org> |
---|---|
date | Sun, 06 May 2018 21:03:19 +0200 |
parents | 1008b4797a6e |
children | 8cac064e6623 |
files | libgui/src/m-editor/file-editor.cc |
diffstat | 1 files changed, 7 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc Sun May 06 20:59:05 2018 +0200 +++ b/libgui/src/m-editor/file-editor.cc Sun May 06 21:03:19 2018 +0200 @@ -397,7 +397,11 @@ settings->sync (); // Finally close all the tabs and return indication that we can exit - // the application or close the editor + // the application or close the editor. + // Closing and deleting the tabs makes the editor visible. In case it was + // hidden before, this state has to be restored afterwards + bool vis = isVisible (); + for (int i = m_tab_widget->count () - 1; i >= 0; i--) { // backwards loop since m_tab_widget->count () changes during the loop @@ -405,6 +409,8 @@ m_tab_widget->removeTab (i); } + setVisible (vis); + return true; }