Skip to content

feat(desktop): dark Windows title bar (DWM immersive dark mode)#18

Open
danielz1z wants to merge 1 commit into
CreepsoOff:feat/mediamp-sg-reworkfrom
danielz1z:polish-titlebar-0124
Open

feat(desktop): dark Windows title bar (DWM immersive dark mode)#18
danielz1z wants to merge 1 commit into
CreepsoOff:feat/mediamp-sg-reworkfrom
danielz1z:polish-titlebar-0124

Conversation

@danielz1z

Copy link
Copy Markdown

What

On Windows, render the desktop window's native title bar in dark mode so it matches Nuvio's near-black UI instead of the default white caption.

How

After the Compose Window is realized, apply DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, true) via a small WindowsChromePolish helper (using the JNA already on the desktop classpath). Falls back to the pre-20H1 attribute index (19) on older Windows 10. All calls are guarded and HRESULTs are logged through DesktopRuntimeLog; no-ops on non-Windows.

Scope & safety

  • Windows-only — gated behind an OS check; macOS/Linux untouched.
  • Window stays decorated — this only recolors the existing native caption (a non-client attribute), so it never touches the client/video surface.
  • Fullscreen-safe: the borderless-fullscreen path already strips the caption (WS_CAPTION → WS_POPUP), so the attribute is inert in fullscreen. Verified live on Windows 11: caption darkens in windowed mode, fullscreen playback unaffected.
  • No new dependencies.

Changes

  • composeApp/src/desktopMain/.../desktop/DesktopWindowChrome.kt (new) — WindowsChromePolish.apply(window)
  • composeApp/src/desktopMain/.../DesktopApp.kt — Windows-gated call in the window's DisposableEffect

🤖 Generated with Claude Code

Apply DWMWA_USE_IMMERSIVE_DARK_MODE to the desktop window on Windows so the
native title bar renders dark (matching Nuvio's near-black UI) instead of the
default white caption. Falls back to the pre-20H1 attribute index (19) on older
Win10; HRESULT-logged and fully guarded (no-ops on non-Windows / on failure).

The window stays decorated, so this is a non-client/caption-only change: native
fullscreen (the borderless-fullscreen controller strips the caption anyway),
Aero Snap, resize and maximize are all unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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