mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix (workaround) for the window freezes after lock screen (Win+L)
Co-authored-by: taooceros <hongtao_zhang@outlook.com>
This commit is contained in:
parent
d6ec4b51d5
commit
020ced45d0
2 changed files with 10 additions and 0 deletions
|
|
@ -18,6 +18,7 @@
|
||||||
Height="600" Width="900"
|
Height="600" Width="900"
|
||||||
MinWidth="850"
|
MinWidth="850"
|
||||||
MinHeight="500"
|
MinHeight="500"
|
||||||
|
Loaded="OnLoaded"
|
||||||
Closed="OnClosed"
|
Closed="OnClosed"
|
||||||
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}">
|
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}">
|
||||||
<Window.InputBindings>
|
<Window.InputBindings>
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Interop;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
using NHotkey;
|
using NHotkey;
|
||||||
|
|
@ -35,6 +36,14 @@ namespace Flow.Launcher
|
||||||
}
|
}
|
||||||
|
|
||||||
#region General
|
#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)
|
private void OnAutoStartupChecked(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue