Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore window position without default instance #3878

Merged
merged 1 commit into from Aug 11, 2023

Conversation

HebaruSan
Copy link
Member

Problem

If you don't have a default game instance, the GUI window will always appear in its default location as if you have never run CKAN before. This can be annoying if you have a strong preference for having appear in a particular spot on the screen or at a particular size.

Cause

The window geometry is saved per-instance, and as of #3829 and #3863, we display the GUI window as early as possible, and if there's no default instance, then the window appears before you choose an instance. There was no clearly best way to load the geometry without an instance.

Changes

Now if you have no default instance, we scan your (valid) instances to find the one with the most recently written CKAN/GUIConfig.xml file, and then we load that configuration. This way the window will appear wherever it was when you most recently closed CKAN, even with no default instance. If you have no instances at all (or if all of your instances are corrupted), we fall back to the baseline defaults.

Fixes #3870.

@HebaruSan HebaruSan added Bug Easy This is easy to fix GUI Issues affecting the interactive GUI labels Aug 10, 2023
Copy link
Member

@techman83 techman83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, I like that logic! Thanks @HebaruSan

@HebaruSan HebaruSan merged commit 399d82f into KSP-CKAN:master Aug 11, 2023
10 checks passed
@HebaruSan HebaruSan deleted the fix/gui-config-load branch August 11, 2023 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Easy This is easy to fix GUI Issues affecting the interactive GUI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: [1.33.2] CKAN does not remember the last window position
2 participants