The first commit is basically a copied, simplified and adapted version of gbp-editor-session-addin.
All the issue with current grid restoring is described in the second commit, which FWIW doesn't even fix the issue (?!).
So I thought about it and I'm wondering:
- Is IdeSession(Addin) only meant to restore the grid pages ? Currently it's only used for that so I'm wondering. It seems at least that the documentation of
This includes open documents and editor splits to the degree possible..
- If it's the case, then its API could be changed like so:
- in the saving functions of each separate IdeSessionAddin, stop saving the frame's position with column/row/depth in the GVariant, but let the IdeSession do this saving work
- Same general principal for the restoring: the addins are asked to build an IdePage based on the GVariant it saved beforehand, and the addin returns it as the async call's return thing (with
ide_task_return*), then the IdeSession, which handles all the restoring/saving of pages' position in the grid, adds it to the correct location it saved.
With those possible changes, it should be possible way more easy to add session restore addins, with less duplication of code like done here between the devhelp's and the editor's session addin.
WDYT of this change in who's responsible to restore the position of the pages in the grid ?