diff --git a/JL.Windows/GUI/MainWindow.xaml.cs b/JL.Windows/GUI/MainWindow.xaml.cs index fb3684de..5c8dfa21 100644 --- a/JL.Windows/GUI/MainWindow.xaml.cs +++ b/JL.Windows/GUI/MainWindow.xaml.cs @@ -158,12 +158,15 @@ public async Task CopyFromWebSocket(string text) HandlePostCopy(text); - if (ConfigManager.AutoLookupFirstTermWhenTextIsCopiedFromWebSocket - && (!ConfigManager.AutoLookupFirstTermOnTextChangeOnlyWhenMainWindowIsMinimized - || WindowState is WindowState.Minimized)) + await Dispatcher.Invoke(async () => { - await FirstPopupWindow.LookupOnCharPosition(MainTextBox, text, 0, true).ConfigureAwait(false); - } + if (ConfigManager.AutoLookupFirstTermWhenTextIsCopiedFromWebSocket + && (!ConfigManager.AutoLookupFirstTermOnTextChangeOnlyWhenMainWindowIsMinimized + || WindowState is WindowState.Minimized)) + { + await FirstPopupWindow.LookupOnCharPosition(MainTextBox, text, 0, true).ConfigureAwait(false); + } + }).ConfigureAwait(false); } } }