Workaround HDR being captured as SDR issue

This commit is contained in:
Yukino Song
2024-09-03 17:31:56 +08:00
parent d332f1dadb
commit 49adbd098f
4 changed files with 117 additions and 17 deletions

View File

@@ -368,6 +368,24 @@ namespace proc {
_app_launch_time = std::chrono::steady_clock::now();
#ifdef _WIN32
auto resetHDRThread = std::thread([this]{
std::this_thread::sleep_for(200ms);
// Windows doesn't seem to be able to set HDR correctly when a display is just connected,
// so we have tooggle HDR for the virtual display manually.
std::string currentDisplay = this->display_name;
if (!currentDisplay.empty()) {
if (VDISPLAY::ensureDisplayHDR(platf::from_utf8(currentDisplay).c_str())) {
BOOST_LOG(info) << "HDR rsestted for display " << currentDisplay;
} else {
BOOST_LOG(info) << "HDR not applied for display " << currentDisplay;
};
}
});
resetHDRThread.detach();
#endif
fg.disable();
return 0;