Skip to content

Commit fda1970

Browse files
Shadetailclaude
andcommitted
Force dark title bar regardless of OS light/dark setting; v1.0.4
Without opting in via DWMWA_USE_IMMERSIVE_DARK_MODE the title bar went white whenever the window lost focus, and a scopes app lives unfocused. The app is dark-themed throughout, so skip the OS query and always dark. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a7d8598 commit fda1970

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ User-facing changes per release. When a `vX.Y.Z` tag is pushed, the release
44
workflow copies the matching `## vX.Y.Z` section into the GitHub Release body,
55
so every release ships with a readable summary.
66

7+
## v1.0.4 — 2026-08-16
8+
9+
- The title bar is now always dark to match the app's dark theme. Previously
10+
it followed legacy Windows behavior and turned white whenever the window
11+
lost focus — which is most of the time for a scopes app you watch while
12+
working elsewhere.
13+
714
## v1.0.3 — 2026-08-16
815

916
- CIE: the spectral-locus horseshoe is drawn as a smooth spline through the

‎CMakeLists.txt‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required(VERSION 3.20)
2-
project(HDRScopes VERSION 1.0.3 LANGUAGES CXX)
2+
project(HDRScopes VERSION 1.0.4 LANGUAGES CXX)
33
if(MSVC)
44
enable_language(RC)
55
endif()
@@ -49,7 +49,7 @@ add_executable(HDRScopes WIN32
4949
target_include_directories(HDRScopes PRIVATE src resources)
5050
target_link_libraries(HDRScopes PRIVATE
5151
imgui
52-
d3d11 dxgi d3dcompiler dxguid msimg32 winmm
52+
d3d11 dxgi d3dcompiler dxguid dwmapi msimg32 winmm
5353
)
5454
target_compile_definitions(HDRScopes PRIVATE UNICODE _UNICODE NOMINMAX WIN32_LEAN_AND_MEAN)
5555

‎src/main.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "backends/imgui_impl_dx11.h"
2727

2828
#include <d3d11.h>
29+
#include <dwmapi.h>
2930
#include <timeapi.h>
3031
#include <algorithm>
3132

@@ -509,6 +510,12 @@ int WINAPI wWinMain(HINSTANCE hInst, HINSTANCE, LPWSTR, int) {
509510
wx, wy, ww, wh, nullptr, nullptr, hInst, nullptr);
510511
g_hwnd = hwnd;
511512

513+
// The app is dark-themed throughout, so force a dark title bar regardless
514+
// of the OS light/dark setting (without this Windows paints it light when
515+
// the window is unfocused — and a scopes app lives unfocused).
516+
BOOL darkTitle = TRUE;
517+
DwmSetWindowAttribute(hwnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &darkTitle, sizeof(darkTitle));
518+
512519
if (!g_d3d.Init(hwnd)) { HDRLog("D3D init failed"); return 1; }
513520

514521
IMGUI_CHECKVERSION(); ImGui::CreateContext();

0 commit comments

Comments
 (0)