From dddbaded42d868ed229aaa06161d496b53155d2a Mon Sep 17 00:00:00 2001 From: SkrubbySkrubInAShrub Date: Wed, 22 Apr 2026 22:46:19 +0200 Subject: [PATCH 1/3] feat(HDR): warn users when in exclusive fullscreen --- src/Features/HDRDisplay.cpp | 15 +++++++++++++++ src/Features/HDRDisplay.h | 1 + src/Hooks.cpp | 4 ++++ 3 files changed, 20 insertions(+) diff --git a/src/Features/HDRDisplay.cpp b/src/Features/HDRDisplay.cpp index a7b086329f..b7573ccdb1 100644 --- a/src/Features/HDRDisplay.cpp +++ b/src/Features/HDRDisplay.cpp @@ -248,6 +248,7 @@ namespace } bool HDRDisplay::isHDRMonitor = false; +bool HDRDisplay::wasExclusiveFullscreen = false; bool HDRDisplay::DetectHDR() { @@ -278,6 +279,20 @@ void HDRDisplay::DrawSettings() } else { ImGui::TextColored(Util::Colors::GetWarning(), "SDR Display (HDR not detected)"); } + + const bool isExclusiveFullscreen = globals::features::upscaling.loaded + ? !globals::features::upscaling.isWindowed + : wasExclusiveFullscreen; + + if (isExclusiveFullscreen) { + ImGui::Spacing(); + ImGui::PushStyleColor(ImGuiCol_Text, Util::Colors::GetWarning()); + ImGui::TextWrapped("WARNING: Exclusive Fullscreen detected."); + ImGui::TextWrapped("HDR is not compatible with Exclusive Fullscreen and may not work correctly. Switch to Borderless Windowed mode for proper HDR support."); + ImGui::PopStyleColor(); + ImGui::Spacing(); + } + ImGui::Spacing(); // Gate HDR checkbox behind monitor detection diff --git a/src/Features/HDRDisplay.h b/src/Features/HDRDisplay.h index e2f25508b8..40b01c431b 100644 --- a/src/Features/HDRDisplay.h +++ b/src/Features/HDRDisplay.h @@ -114,6 +114,7 @@ struct HDRDisplay : public Feature static bool DetectHDR(); static bool isHDRMonitor; + static bool wasExclusiveFullscreen; // EFS detected at swapchain creation; incompatible with HDR bool pendingAutoDetect = false; float GetDisplayMaxLuminance() const; diff --git a/src/Hooks.cpp b/src/Hooks.cpp index c09dc8e227..30f36bd49f 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -364,6 +364,10 @@ HRESULT WINAPI hk_D3D11CreateDeviceAndSwapChain( modifiedDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_DISCARD; if (modifiedDesc.BufferCount < 2) modifiedDesc.BufferCount = 2; + + if (!modifiedDesc.Windowed) + HDRDisplay::wasExclusiveFullscreen = true; + logger::info("[HDR] Upgraded swap chain: R10G10B10A2_UNORM + FLIP_DISCARD"); } From fbc885b6d1b1bd562c6c4bc0ca6d571588ffe63e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 22 Apr 2026 20:48:55 +0000 Subject: [PATCH 2/3] =?UTF-8?q?style:=20=F0=9F=8E=A8=20apply=20pre-commit.?= =?UTF-8?q?ci=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automated formatting by clang-format, prettier, and other hooks. See https://pre-commit.ci for details. --- src/Features/HDRDisplay.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/Features/HDRDisplay.cpp b/src/Features/HDRDisplay.cpp index b7573ccdb1..b427038a57 100644 --- a/src/Features/HDRDisplay.cpp +++ b/src/Features/HDRDisplay.cpp @@ -280,9 +280,7 @@ void HDRDisplay::DrawSettings() ImGui::TextColored(Util::Colors::GetWarning(), "SDR Display (HDR not detected)"); } - const bool isExclusiveFullscreen = globals::features::upscaling.loaded - ? !globals::features::upscaling.isWindowed - : wasExclusiveFullscreen; + const bool isExclusiveFullscreen = globals::features::upscaling.loaded ? !globals::features::upscaling.isWindowed : wasExclusiveFullscreen; if (isExclusiveFullscreen) { ImGui::Spacing(); From a941d986de18fd0f4f6914871fd323929ba29792 Mon Sep 17 00:00:00 2001 From: SkrubbySkrubInAShrub Date: Wed, 22 Apr 2026 22:55:57 +0200 Subject: [PATCH 3/3] fix: AI comment --- src/Hooks.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Hooks.cpp b/src/Hooks.cpp index 30f36bd49f..eef88299cb 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -365,8 +365,7 @@ HRESULT WINAPI hk_D3D11CreateDeviceAndSwapChain( if (modifiedDesc.BufferCount < 2) modifiedDesc.BufferCount = 2; - if (!modifiedDesc.Windowed) - HDRDisplay::wasExclusiveFullscreen = true; + HDRDisplay::wasExclusiveFullscreen = !modifiedDesc.Windowed; logger::info("[HDR] Upgraded swap chain: R10G10B10A2_UNORM + FLIP_DISCARD"); }