mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-03 03:19:08 +08:00
Fix issue with Layered Window
This commit is contained in:
parent
343da4878d
commit
2ec71c9942
@ -51,8 +51,6 @@ namespace Wox.Helper
|
||||
WindowInteropHelper helper = new WindowInteropHelper(window);
|
||||
int val = 2;
|
||||
int ret1 = DwmSetWindowAttribute(helper.Handle, 2, ref val, 4);
|
||||
window.Background = Brushes.Transparent;
|
||||
HwndSource.FromHwnd(helper.Handle).CompositionTarget.BackgroundColor = Color.FromArgb(0, 0, 0, 0);
|
||||
|
||||
if (ret1 == 0)
|
||||
{
|
||||
|
@ -8,6 +8,7 @@ using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using WindowsInput;
|
||||
@ -97,6 +98,9 @@ namespace Wox
|
||||
if (UserSettingStorage.Instance.OpacityMode == OpacityMode.DWM)
|
||||
DwmDropShadow.DropShadowToWindow(this);
|
||||
|
||||
this.Background = Brushes.Transparent;
|
||||
HwndSource.FromHwnd(new WindowInteropHelper(this).Handle).CompositionTarget.BackgroundColor = Color.FromArgb(0, 0, 0, 0);
|
||||
|
||||
WindowIntelopHelper.DisableControlBox(this);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
</Style.Resources>
|
||||
</Style>
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
<Setter Property="Background" Value="#00000000"></Setter>
|
||||
<Setter Property="Background" Value="#01ffffff"></Setter>
|
||||
</Style>
|
||||
<Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" >
|
||||
</Style>
|
||||
|
@ -16,7 +16,7 @@
|
||||
</Style.Resources>
|
||||
</Style>
|
||||
<Style x:Key="WindowBorderStyle" BasedOn="{StaticResource BaseWindowBorderStyle}" TargetType="{x:Type Border}">
|
||||
<Setter Property="Background" Value="#00000000"></Setter>
|
||||
<Setter Property="Background" Value="#01000000"></Setter>
|
||||
</Style>
|
||||
<Style x:Key="WindowStyle" TargetType="{x:Type Window}" BasedOn="{StaticResource BaseWindowStyle}" >
|
||||
</Style>
|
||||
|
Loading…
Reference in New Issue
Block a user