Skip to content

gui: Add support for session autosaving

Vanadiae requested to merge Vanadiae/gnome-builder:session-autosave into master

Currently if Builder crashes then all the pages opening/closing/moving and any state a page had modified will be lost entirely, because saving is only done when closing the primary workspace.

So to avoid this big issue, this commit adds support for automatically saving the grid's session state whenever a page is added/closed/moved, or one of the worthy page properties changes, as defined by its session addin. This also makes the IdeSession a bit more stateful, in the sense that to be able to do the autosaving there (instead of in the IdeEditorSurface code) it needs to know what grids needs to be saved at any time, so it can't just rely on the IdeEditorSurface to pass the grid the same way as it did with ide_session_save_async().

So now Builder should be more reliable to such crashes, or at least the workspace will be restored up to five minutes ago.

Merge request reports