BF: Error when AUI perspective loads if window size is negative #6192
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.
This bug comes up when resizing the coder window. Since there is no
SetMinSizecall, the window can be resized to (-1. -1). The app will raise an unhandled exception, and the AUI perspective will be invalid. The coder window cannot be resized since it will always raise an error when the user attempts to resize it. If the app is closed, the invalid AUI layout will be saved and loaded next startup. This will crash the app since it is invalid, preventing the app from making it past the splash screen.This fixes the issue by ensuring
SetMinSize()is always called to prevent the window from being size too small in the first place. The second modification catches the error and manually sets up the window. This should generalize to other AUI perspective errors, allowing the app to get a fresh, default layout on any error.