mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +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:
@@ -49,7 +49,17 @@ public partial class OCROverlay : Window
|
||||
Top = screenRectangle.Top >= 0 ? screenRectangle.Top : screenRectangle.Top + (screenRectangle.Height / 2);
|
||||
|
||||
InitializeComponent();
|
||||
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, Wpf.Ui.Controls.WindowBackdropType.None);
|
||||
|
||||
// workaround for #30177
|
||||
try
|
||||
{
|
||||
Wpf.Ui.Appearance.SystemThemeWatcher.Watch(this, Wpf.Ui.Controls.WindowBackdropType.None);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Logger.LogError($"Exception in SystemThemeWatcher.Watch, issue 30177. {ex.Message}");
|
||||
}
|
||||
|
||||
PopulateLanguageMenu();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user