diff --git a/Core/Handling/General/BrowserProcessHandler.cs b/Core/Handling/General/BrowserProcessHandler.cs index 7c4dc1b0..fe7f84a1 100644 --- a/Core/Handling/General/BrowserProcessHandler.cs +++ b/Core/Handling/General/BrowserProcessHandler.cs @@ -3,12 +3,20 @@ namespace TweetDuck.Core.Handling.General{ sealed class BrowserProcessHandler : IBrowserProcessHandler{ - void IBrowserProcessHandler.OnContextInitialized(){ + public static void UpdatePrefs(){ + Cef.UIThreadTaskFactory.StartNew(UpdatePrefsInternal); + } + + private static void UpdatePrefsInternal(){ using(IRequestContext ctx = Cef.GetGlobalRequestContext()){ ctx.SetPreference("browser.enable_spellchecking", Program.UserConfig.EnableSpellCheck, out string _); } } + void IBrowserProcessHandler.OnContextInitialized(){ + UpdatePrefsInternal(); + } + void IBrowserProcessHandler.OnScheduleMessagePumpWork(long delay){} void IDisposable.Dispose(){} } diff --git a/Core/Other/FormSettings.cs b/Core/Other/FormSettings.cs index f793e355..71db8356 100644 --- a/Core/Other/FormSettings.cs +++ b/Core/Other/FormSettings.cs @@ -3,6 +3,7 @@ using System.Drawing; using System.Windows.Forms; using TweetDuck.Core.Controls; +using TweetDuck.Core.Handling.General; using TweetDuck.Core.Notification.Example; using TweetDuck.Core.Other.Analytics; using TweetDuck.Core.Other.Settings; @@ -66,7 +67,8 @@ private void btnManageOptions_Click(object sender, EventArgs e){ if (dialog.ShowDialog() == DialogResult.OK){ browser.ResumeNotification(); - + + BrowserProcessHandler.UpdatePrefs(); ShouldReloadBrowser = dialog.ShouldReloadBrowser; Close(); } diff --git a/Core/Other/Settings/TabSettingsGeneral.cs b/Core/Other/Settings/TabSettingsGeneral.cs index da54ce7f..ebdc9c87 100644 --- a/Core/Other/Settings/TabSettingsGeneral.cs +++ b/Core/Other/Settings/TabSettingsGeneral.cs @@ -1,5 +1,6 @@ using System; using TweetDuck.Core.Controls; +using TweetDuck.Core.Handling.General; using TweetDuck.Updates; namespace TweetDuck.Core.Other.Settings{ @@ -61,7 +62,7 @@ private void checkBestImageQuality_CheckedChanged(object sender, EventArgs e){ private void checkSpellCheck_CheckedChanged(object sender, EventArgs e){ Config.EnableSpellCheck = checkSpellCheck.Checked; - PromptRestart(); + BrowserProcessHandler.UpdatePrefs(); } private void trackBarZoom_ValueChanged(object sender, EventArgs e){