diff --git a/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs b/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs index db04f4c18d..ee338b0e4b 100644 --- a/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs +++ b/src/modules/colorPicker/ColorPickerUI/Helpers/AppStateHandler.cs @@ -135,6 +135,14 @@ namespace ColorPicker.Helpers Application.Current.MainWindow.Opacity = 0; Application.Current.MainWindow.Visibility = Visibility.Visible; _colorPickerShown = true; + + // HACK: WPF UI theme watcher removes the composition target background color, among other weird stuff. + // https://github.com/lepoco/wpfui/blob/303f0aefcd59a142bc681415dc4360a34a15f33d/src/Wpf.Ui/Controls/Window/WindowBackdrop.cs#L280 + // So we set it back with https://github.com/lepoco/wpfui/blob/303f0aefcd59a142bc681415dc4360a34a15f33d/src/Wpf.Ui/Controls/Window/WindowBackdrop.cs#L191 + // And also reapply the intended backdrop. + // This hack fixes: https://github.com/microsoft/PowerToys/issues/31725 + Wpf.Ui.Controls.WindowBackdrop.RemoveBackground(Application.Current.MainWindow); + Wpf.Ui.Controls.WindowBackdrop.ApplyBackdrop(Application.Current.MainWindow, Wpf.Ui.Controls.WindowBackdropType.None); } }