diff --git a/Flow.Launcher/Helper/ErrorReporting.cs b/Flow.Launcher/Helper/ErrorReporting.cs index e2431fd4f..797f31482 100644 --- a/Flow.Launcher/Helper/ErrorReporting.cs +++ b/Flow.Launcher/Helper/ErrorReporting.cs @@ -25,12 +25,6 @@ public static class ErrorReporting // This change modifies the behavior to log the exception instead of showing the "Error report UI". if (ExceptionHelper.IsRecoverableDwmCompositionException(e)) return; - // Workaround for a WPF issue where changing the Windows theme or accent color triggers - // SystemResources.InvalidateTreeResources, which tries to clone Color values stored in styles - // and fails with an InvalidCastException. This is a benign framework-level exception that - // does not affect Flow Launcher functionality, so we log it silently instead of showing the error dialog. - if (ExceptionHelper.IsRecoverableSystemResourceException(e)) return; - var reportWindow = new ReportWindow(e); reportWindow.Show(); } diff --git a/Flow.Launcher/Helper/ExceptionHelper.cs b/Flow.Launcher/Helper/ExceptionHelper.cs index 0cc7747ad..5dd57f9bb 100644 --- a/Flow.Launcher/Helper/ExceptionHelper.cs +++ b/Flow.Launcher/Helper/ExceptionHelper.cs @@ -39,23 +39,4 @@ internal static class ExceptionHelper return !string.IsNullOrEmpty(stackTrace) && stackTrace.Contains("DwmCompositionChanged", StringComparison.OrdinalIgnoreCase); } - - /// - /// Returns true if the exception is a recoverable WPF system resource invalidation exception - /// that occurs when Windows changes its theme or accent colors. This is a known WPF issue where - /// Color values stored in styles are incorrectly cloned during resource tree invalidation. - /// - internal static bool IsRecoverableSystemResourceException(Exception exception) - { - if (exception is not InvalidCastException) - { - return false; - } - - // Check for the specific Color-to-Expression cast failure originating from WPF's - // SystemResources.InvalidateTreeResources, triggered by Windows theme/accent color changes. - var stackTrace = exception.StackTrace; - return !string.IsNullOrEmpty(stackTrace) && - stackTrace.Contains("System.Windows.SystemResources.InvalidateTreeResources", StringComparison.Ordinal); - } }