mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
[ImageResizer] Workaround for exception in wpf ui. (#30225)
* [ImageResizer] Workaround for exception in wpf ui. * Adding try catch to the other 3 places the SystemThemeWatcher is used. Rearranging code in Image Resizer, which might solve the issue.
This commit is contained in:
@@ -56,8 +56,6 @@ namespace PowerLauncher
|
||||
_settings = settings;
|
||||
InitializeComponent();
|
||||
|
||||
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this);
|
||||
|
||||
if (OSVersionHelper.IsWindows11())
|
||||
{
|
||||
WindowBackdropType = Wpf.Ui.Controls.WindowBackdropType.Acrylic;
|
||||
@@ -67,6 +65,16 @@ namespace PowerLauncher
|
||||
WindowBackdropType = Wpf.Ui.Controls.WindowBackdropType.None;
|
||||
}
|
||||
|
||||
// workaround for #30217
|
||||
try
|
||||
{
|
||||
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, WindowBackdropType);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.Exception("Exception in SystemThemeWatcher.Watch, issue 30217.", ex, GetType());
|
||||
}
|
||||
|
||||
_firstDeleteTimer.Elapsed += CheckForFirstDelete;
|
||||
_firstDeleteTimer.Interval = 1000;
|
||||
NativeEventWaiter.WaitForEventLoop(
|
||||
|
||||
Reference in New Issue
Block a user