fix(fonts): marshal font chooser results onto the framework thread
Three FontChooser ContinueWith handlers wrote Mutable.* directly from the threadpool. Wrap the result-write in Plugin.Framework.Run so the mutation lands on the same thread that owns the rest of the UI state. Matches the marshalling pattern already used by Database.cs and Privacy.cs background work.
This commit is contained in:
@@ -147,7 +147,9 @@ internal sealed class Appearance : ISettingsTab
|
||||
globalChooser?.ResultTask.ContinueWith(r =>
|
||||
{
|
||||
if (r.IsCompletedSuccessfully)
|
||||
Mutable.GlobalFontV2 = r.Result;
|
||||
{
|
||||
Plugin.Framework.Run(() => Mutable.GlobalFontV2 = r.Result);
|
||||
}
|
||||
});
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("Reset##global"))
|
||||
@@ -164,7 +166,9 @@ internal sealed class Appearance : ISettingsTab
|
||||
japaneseChooser?.ResultTask.ContinueWith(r =>
|
||||
{
|
||||
if (r.IsCompletedSuccessfully)
|
||||
Mutable.JapaneseFontV2 = r.Result;
|
||||
{
|
||||
Plugin.Framework.Run(() => Mutable.JapaneseFontV2 = r.Result);
|
||||
}
|
||||
});
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("Reset##japanese"))
|
||||
@@ -179,7 +183,9 @@ internal sealed class Appearance : ISettingsTab
|
||||
italicChooser?.ResultTask.ContinueWith(r =>
|
||||
{
|
||||
if (r.IsCompletedSuccessfully)
|
||||
Mutable.ItalicFontV2 = r.Result;
|
||||
{
|
||||
Plugin.Framework.Run(() => Mutable.ItalicFontV2 = r.Result);
|
||||
}
|
||||
});
|
||||
ImGui.SameLine();
|
||||
if (ImGui.Button("Reset##italic"))
|
||||
|
||||
Reference in New Issue
Block a user