Skip to content

Windows 11 25H2 Build 26200.9550: native title bar remains white in Dark theme in 2.8.0-beta1 #13702

Description

@taylor-p-mason

Have you searched for an existing issue?

  • Yes, I tried searching and reviewed the pinned issues

Brief Summary

In KeePassXC 2.8.0-beta1 (Qt 6.11.2) on Windows 11 25H2 26200.9550, the KeePassXC application correctly uses its Dark theme, but the native Windows title bar/window frame at the top of the main window remains white.

This worked correctly in previous KeePassXC 2.7.3 versions. The existing qt.conf workaround for the Windows dark title bar is still present, but it no longer has any effect in the Qt 6 build.

Importantly, I found that the Windows DWM API can change the KeePassXC title bar to dark immediately, so this appears to be a KeePassXC/Qt 6 Windows window-decoration issue rather than a Windows dark-mode configuration problem.

Environment
KeePassXC - Version 2.8.0-beta1
Build Type: Snapshot
Revision: 9e0f57a
Distribution: Native

Qt 6.11.2
Debugging mode is disabled.

Operating system: Windows 11 Version 25H2
CPU architecture: x86_64
Kernel: winnt 10.0.26200

Enabled extensions:

  • Auto-Type
  • KeeShare
  • Hardware Keys
  • Quick Unlock
  • Browser Integration
  • Passkeys
  • SSH Agent

Cryptographic libraries:

  • Botan 3.12.0

Windows itself is configured to use Dark mode.

Steps to Reproduce

Run KeePassXC 2.8.0-beta1 on Windows 11 25H2.

Set KeePassXC's application theme to Dark.

Restart KeePassXC.

Observe the native title bar/window frame at the top of the main KeePassXC window.

Expected Versus Actual Behavior

Expected Behavior

The native Windows title bar/frame should follow the KeePassXC Dark theme, as it did in previous KeePassXC versions.

Actual Behavior

The KeePassXC application itself is dark, but the native Windows title bar/frame remains white.

The contrast is particularly noticeable because the entire application below the title bar is dark.

Existing KeePassXC Qt configuration

The installed qt.conf already contains:

[Platforms]
WindowsArguments = darkmode=1

However, this has no effect in 2.8.0-beta1.

I also tested:

-platform windows:darkmode=1

and:

-platform windows:darkmode=2

Neither changes the title bar.

I also tested:

QT_STYLE_OVERRIDE=windows

with no change.
DWM diagnostic test

I tested the native Windows DWM API directly against the KeePassXC main window.

The following call succeeds:

$p = Get-Process KeePassXC -ErrorAction Stop |
Where-Object { $_.MainWindowHandle -ne 0 } |
Select-Object -First 1

$hwnd = $p.MainWindowHandle

$caption = [int]0x00202020

$result = [DwmTest]::DwmSetWindowAttribute(
[IntPtr]$hwnd,
35,
[ref]$caption,
4
)

Write-Host "Result = $result"

The result is:

Result = 0

and, importantly, the KeePassXC title bar immediately changes from white to dark.

35 is DWMWA_CAPTION_COLOR.

I also tested DWMWA_USE_IMMERSIVE_DARK_MODE (attribute 20), as well as the DWM border/text attributes. The explicit caption-color attribute is sufficient by itself to correct the visible title bar.

This appears to demonstrate that:

The KeePassXC main window is a normal DWM-managed Windows window.

Windows 11 accepts the requested caption color.

The title bar can be rendered correctly without changing any global Windows theme settings.

The problem is therefore likely in the Qt 6/KeePassXC handling of the native Windows window decoration.

Regression / historical context

KeePassXC previously had an explicit Windows fix for this behavior:

2.7.3: "Enable dark title bar on windows when accent color is not used" (#8498).

The qt.conf mechanism from that fix is still present in the 2.8.0-beta1 installation, but does not produce the expected result with the Qt 6 build.

This appears to be a regression or behavior change associated with the Qt 5 → Qt 6 migration.
Possible direction for investigation

The fact that:

DwmSetWindowAttribute(
hwnd,
DWMWA_CAPTION_COLOR,
...
)

immediately fixes the problem suggests that the Windows caption color is simply not being set correctly by the Qt/KeePassXC Qt 6 path.

It may be worth checking the interaction between KeePassXC's Dark palette and Qt 6's Windows platform plugin when the native HWND is created.

I would expect the application to set the native Windows caption/frame consistently with its selected KeePassXC theme, without requiring users to use an external PowerShell workaround.

Additional information

This is reproducible on the 2.8.0-beta1 snapshot identified above.

The behavior is not caused by the Windows global Dark/Light setting: Windows is already configured for Dark mode, and explicitly setting the DWM caption color on the KeePassXC HWND immediately corrects the appearance.

I'm happy to provide the PowerShell test script (KeePassXC-DarkTitleBar.ps1):

Add-Type @"
using System;
using System.Runtime.InteropServices;

public static class DwmKeepass {
    [DllImport("dwmapi.dll")]
    public static extern int DwmSetWindowAttribute(
        IntPtr hwnd,
        int attribute,
        ref int value,
        int size);
}
"@

# Start KeePassXC
Start-Process "D:\PC Settings\Password Manager\KeePassXC.exe"

# Wait for its main window
$hwnd = [IntPtr]::Zero

for ($i = 0; $i -lt 100; $i++) {
    Start-Sleep -Milliseconds 100

    $p = Get-Process KeePassXC -ErrorAction SilentlyContinue |
        Where-Object { $_.MainWindowHandle -ne 0 } |
        Select-Object -First 1

    if ($p) {
        $hwnd = [IntPtr]$p.MainWindowHandle
        break
    }
}

if ($hwnd -eq [IntPtr]::Zero) {
    exit 1
}

# DWMWA_CAPTION_COLOR = 35
# COLORREF 0x00BBGGRR
$caption = [int]0x00202020

[DwmKeepass]::DwmSetWindowAttribute(
    $hwnd,
    35,
    [ref]$caption,
    4
)

Create a shortcut and adjust for your path:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -WindowStyle Hidden -ExecutionPolicy Bypass -File "C:\Program Files\Password Manager\KeePassXC-DarkTitleBar.ps1"

KeePassXC Debug Information


Operating System

Windows

Linux Desktop Environment

None

Linux Windowing System

None

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions