Skip to content

Commit 6926628

Browse files
committed
Add settings toggle for force synchronous font enumeration
1 parent c67a86d commit 6926628

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

WineFix/WineFixPlugin.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,16 @@ public class WineFixPlugin : AffinityPlugin
1212
{
1313
public const string PluginId = "winefix";
1414
public const string ColorPickerModeKey = "color_picker_mode";
15+
public const string ForceSyncFontEnumKey = "force_sync_font_enum";
1516

1617
public override PluginSettingsDefinition DefineSettings()
1718
{
1819
return new PluginSettingsDefinition(PluginId)
20+
.AddSection("Crash Fixes")
21+
.AddBool(ForceSyncFontEnumKey, "Force synchronous font enumeration",
22+
defaultValue: true,
23+
restartRequired: true,
24+
description: "Disable parallel font enumeration to significantly reduce frequency of startup crashes. May increase application startup time on systems with lots of fonts.")
1925
.AddSection("Patches")
2026
.AddEnum(ColorPickerModeKey, "Color Picker Mode",
2127
new List<EnumOption>
@@ -32,6 +38,12 @@ public override void OnPatch(Harmony harmony, IPluginContext context)
3238
context.Patch("MainWindowLoaded fix",
3339
h => Patches.MainWindowLoadedPatch.ApplyPatches(h));
3440

41+
if (context.Settings.GetEffectiveValue<bool>(ForceSyncFontEnumKey))
42+
{
43+
context.Patch("FontEnumeration fix",
44+
h => Patches.FontEnumerationPatch.ApplyPatches(h));
45+
}
46+
3547
context.Patch("ColorPicker Wayland fix",
3648
h => Patches.ColorPickerWaylandPatch.ApplyPatches(h));
3749
}

0 commit comments

Comments
 (0)