Skip to content

fix: Suppress benign DWM_E_COMPOSITIONDISABLED error#38

Merged
Jed556 merged 1 commit into
mainfrom
seer/fix/dwm-composition-disabled
Jun 26, 2026
Merged

fix: Suppress benign DWM_E_COMPOSITIONDISABLED error#38
Jed556 merged 1 commit into
mainfrom
seer/fix/dwm-composition-disabled

Conversation

@sentry

@sentry sentry Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Addresses AUTOMIDIPLAYER-12: System.Runtime.InteropServices.COMException: {Desktop composition is disabled} The operation could not be completed because desktop composition is disabled. (0x80263001).

This COMException occurs when WPF's WindowChrome (used by FluentWindow for Mica/extended title bar) attempts to call DwmExtendFrameIntoClientArea while Desktop Window Manager (DWM) composition is temporarily disabled. This can happen in scenarios like remote desktop sessions or specific system events.

The exception is cosmetic and benign; the window simply won't have the extended glass/Mica frame effect, but the application remains fully functional. Previously, the application's global exception handlers (OnDispatcherUnhandledException, OnUnhandledException, OnUnobservedTaskException) were treating this as a fatal error, leading to a crash dialog and unnecessary Sentry reports.

This fix introduces a helper method IsBenignDwmCompositionException to identify this specific COMException by its HResult (0x80263001). The global exception handlers now:

  • Detect this benign exception.
  • Log a message indicating it's being ignored.
  • Set e.Handled = true (for dispatcher exceptions) or e.SetObserved() (for unobserved task exceptions) to prevent the crash dialog.
  • Skip Sentry reporting for this specific error.

This prevents noisy crash reports and improves user experience by avoiding crash dialogs for a non-critical system state change.

Fixes AUTOMIDIPLAYER-12

@Jed556 Jed556 merged commit c45b181 into main Jun 26, 2026
7 checks passed
@Jed556 Jed556 deleted the seer/fix/dwm-composition-disabled branch June 26, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant