Skip to content

Guard tray_enable_dark_mode with SEH to prevent crash on Windows 10#2

Merged
kdroidFilter merged 2 commits intomasterfrom
window-fix
Feb 3, 2026
Merged

Guard tray_enable_dark_mode with SEH to prevent crash on Windows 10#2
kdroidFilter merged 2 commits intomasterfrom
window-fix

Conversation

@kdroidFilter
Copy link
Copy Markdown
Owner

Summary

  • Wrap tray_enable_dark_mode() in __try/__except (SEH) inside tray_init()
  • The undocumented ordinal 135 of uxtheme.dll (SetPreferredAppMode) can cause an access violation on some Windows 10 builds
  • Dark-mode theming is cosmetic only, so it is safe to skip on failure

Fixes kdroidFilter/ComposeNativeTray#350

Zero-initialize NOTIFYICONIDENTIFIER in tray_windows.c to prevent undefined behavior, ensuring compatibility with Windows APIs. Refactored WindowsTrayManager to improve safety, including null pointer checks, better error handling for memory access issues, and extraction of reusable `safeGetTrayPosition` logic. Updated binaries to reflect these critical fixes.
The undocumented ordinal 135 of uxtheme.dll (SetPreferredAppMode) can
cause an access violation on some Windows 10 builds.  Wrap the call in
__try/__except so the crash is silently caught — dark-mode theming is
cosmetic only and safe to skip.

Fixes kdroidFilter/ComposeNativeTray#350
@kdroidFilter kdroidFilter merged commit 6a89226 into master Feb 3, 2026
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.

Tray icon doesn't appear on Windows 10

1 participant