diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 566ecd61ac3..9513cf41c29 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -18,6 +18,7 @@ Height="600" Width="900" MinWidth="850" MinHeight="500" + Loaded="OnLoaded" Closed="OnClosed" d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}"> diff --git a/Flow.Launcher/SettingWindow.xaml.cs b/Flow.Launcher/SettingWindow.xaml.cs index a922b4d67b4..2823e4ddd8b 100644 --- a/Flow.Launcher/SettingWindow.xaml.cs +++ b/Flow.Launcher/SettingWindow.xaml.cs @@ -2,6 +2,7 @@ using System.IO; using System.Windows; using System.Windows.Input; +using System.Windows.Interop; using System.Windows.Navigation; using Microsoft.Win32; using NHotkey; @@ -35,6 +36,14 @@ public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel) } #region General + private void OnLoaded(object sender, RoutedEventArgs e) + { + // Fix (workaround) for the window freezes after lock screen (Win+L) + // https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf + HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource; + HwndTarget hwndTarget = hwndSource.CompositionTarget; + hwndTarget.RenderMode = RenderMode.SoftwareOnly; + } private void OnAutoStartupChecked(object sender, RoutedEventArgs e) {