Skip to content

Commit d64642f

Browse files
[PTRun]Don't apply transparency fix after theme change on Windows 10 (#33783)
1 parent 57b06fa commit d64642f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/modules/launcher/PowerLauncher/ViewModel/MainViewModel.cs

+6-1
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,12 @@ public void ToggleWox()
10141014
// https://github.com/lepoco/wpfui/blob/303f0aefcd59a142bc681415dc4360a34a15f33d/src/Wpf.Ui/Controls/Window/WindowBackdrop.cs#L280
10151015
// So we set it back with https://github.com/lepoco/wpfui/blob/303f0aefcd59a142bc681415dc4360a34a15f33d/src/Wpf.Ui/Controls/Window/WindowBackdrop.cs#L191
10161016
var window = Application.Current.MainWindow;
1017-
Wpf.Ui.Controls.WindowBackdrop.RemoveBackground(window);
1017+
1018+
// Only makes sense for Windows 11 or greater, since Windows 10 doesn't have Mica.
1019+
if (OSVersionHelper.IsWindows11())
1020+
{
1021+
Wpf.Ui.Controls.WindowBackdrop.RemoveBackground(window);
1022+
}
10181023

10191024
// Setting uint titlebarPvAttribute = 0xFFFFFFFE; works on 22H2 or higher, 21H2 (aka SV1) this value causes a crash
10201025
if (OSVersionHelper.IsGreaterThanWindows11_21H2())

0 commit comments

Comments
 (0)