Community
Participate
Working Groups
The saveState method is called only views in the active perspective. Views from the inactive perspective don't have their saveState called when the workbench shuts down. You can debug(line 1242) the persist() method from Workbench. It gets only the reference for the active perspective views and only for this views it calls the save state.
Do you think you could submit a patch?
Found this problem still persists in Eclipse Neon. Any plans for fixing or workaround ?
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.
The problem still exists. I tested with eclipse 2020-03 (4.15.0) and it's the same code as in 4.5. Only the views from the active perspective have the saveState method called. If you open a view in a perspective then change to another perspective and close the application the saveState is not called. Only if the view is in the active perspective then the eclipse framework calls the saveState. All the changes to the view are lost if the view is in a background perspective. The problem is in WorkbenchPage.getViewReferences. It only lists views from the active perspective. It has the getViewReferences that can get all the open views but it's not used. Simply calling the getViewReferences to return the views from all perspectives would solve the problem.