Skip to content

WineFix: gate MainWindowLoaded patch behind a setting, default off (mitigates #46) - #56

Open
bluejorts wants to merge 1 commit into
noahc3:devfrom
bluejorts:winefix-gate-mainwindowloaded
Open

WineFix: gate MainWindowLoaded patch behind a setting, default off (mitigates #46)#56
bluejorts wants to merge 1 commit into
noahc3:devfrom
bluejorts:winefix-gate-mainwindowloaded

Conversation

@bluejorts

Copy link
Copy Markdown

Summary

On Affinity 3.2.3 the MainWindowLoadedPatch (HasPreviousPackageInstalled returning false) sends the app down the fresh-install onboarding path, which opens a WebView2CompositionControl that crashes under Wine with TypeLoadException: Could not find Windows Runtime type 'Windows.UI.Composition.Compositor' (#46, full diagnosis there). Forcing true instead triggers a legacy beta migration path, so no constant is safe on 3.2.x.

This PR exposes the patch as a WineFix setting, main_window_loaded_fix, defaulting to disabled. When disabled, HasPreviousPackageInstalled throws under Wine as before, which aborts OnMainWindowLoaded before the onboarding page loads. That's the same (accidental) protection vanilla Affinity.exe launches rely on.

Trade-off

The prefs saving fix that this patch provides is inactive unless the user opts in. Users on Affinity versions where the onboarding path isn't hit can re-enable it from the WineFix preferences page. If you'd rather fix this by suppressing the onboarding WebView2 control so the patch can stay default-on, I can rework it in that direction.

Testing

Affinity 3.2.3.4646, Wine 11.13 + DXVK 3.0.2, Arch Linux, KDE Plasma (Wayland/XWayland), NVIDIA RTX 3090:

  • Default (disabled): AffinityHook launches to the main window, documents open and edit normally, no WebView2 crash. APL log shows the skip message at Stage 1.
  • Enabled: reproduces the Webview2 crash with restored Canva sign-in #46 crash on this Affinity version, as expected.

On Affinity 3.2.3 the HasPreviousPackageInstalled patch sends the app down
the fresh-install onboarding path, which hosts a WebView2CompositionControl
that crashes under Wine (TypeLoadException: Windows.UI.Composition.Compositor,
see noahc3#46). Forcing true instead triggers a bogus
legacy beta font migration. Neither constant works on 3.2.x, so expose the
patch as a main_window_loaded_fix setting defaulting to disabled; the
unpatched method throwing under Wine skips onboarding, matching vanilla
Affinity.exe behaviour. Trade-off: the prefs-saving fix is inactive unless
the user opts in.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant