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

Fix GUI freeze with non-empty changeset at startup #3708

Merged
merged 1 commit into from Nov 17, 2022

Conversation

HebaruSan
Copy link
Member

Problem

After KSP-CKAN/NetKAN#9438 and KSP-CKAN/CKAN-meta#3125, ZeroMiniAVC becomes auto-uninstallable (see #2753) for most users who have it. Unfortunately the client has problems with this.

The change set tab appears and the Apply changes button becomes enabled while the GUI is still responsive, but clicking Apply changes or the change set tab froze the GUI. Multiple users have reported this on the forum and Discord.

Steps to reproduce:

  1. Start CKAN
  2. Install ToolbarController, ClickThroughBlocker, and ZeroMiniAVC
  3. Mark ZeroMiniAVC as auto-installed
  4. Close CKAN
  5. Start CKAN
  6. The change set tab appears and Apply changes is enabled, and using either one will freeze the GUI

Cause

GUI properties on Changeset are being manipulated from a background thread, rather than WinForms's designated "GUI thread" (:vomiting_face:). This destabilizes that tab, so when we try to make it visible (by clicking the Changeset tab or the Apply changes button) or further manipulate it (by checking or unchecking the Install or auto-installed checkboxes for some mods), something in the runtime seizes up and stops responding during the call to TabControl.SelectTab, which never returns.

Without an auto-uninstallable mod, the change set is empty, so the tab isn't updated.

Changes

Now ManageMods.ChangeSetUpdated is wrapped in a Util.Invoke call, since this is the outermost part of the relevant call stack that sets GUI properties (which were harmless at this level but still technically not allowed). This will allow the change set tab to be updated without being corrupted.

Fixes #3707.

@HebaruSan HebaruSan added Bug GUI Issues affecting the interactive GUI Pull request labels Nov 16, 2022
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.

Ok that's super annoying, good find!

@HebaruSan HebaruSan merged commit aeb2388 into KSP-CKAN:master Nov 17, 2022
@HebaruSan HebaruSan deleted the fix/changeset-freeze branch November 17, 2022 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI Issues affecting the interactive GUI Pull request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] GUI freezes on switch to changeset tab after refresh removing ZeroMiniAVC dependencies
2 participants