Add workaround for layout persistance issues with macro frames #2682
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #2485. As detailed in the discussion around the issue, the layout information for frames that are not added to the
DockingManager
before layout is loaded is not retained. This works around that by saving the names of macro frames to a file (frames.dat, just aNULL
delimited list of the names) when Maptool exits and then, when launching, using those names to generate placeholder frames before the layout is loaded so that the layout information is retained. Really, I'd consider this more of a "temporary" workaround to be removed if the issue is ever actually addressed within the library.In my testing, it seems to do the trick, layout seems to restore the same as you'd expect pre-1.8, and I also haven't observed any issue with the encoding of the frame names. I did once observe frames opening incorrectly (they opened docked somewhere I know I hadn't put them, and when opening them in 1.7 they were in the right spot), but I haven't been able to reproduce this so it may have just been due to something I was doing at the time messing with things. Also of note, if the frame is floating its position is not restored, but this is also the case for macro frames in 1.7.
This change is